Disabling sign data hiding in video coding

ABSTRACT

A video coder may determine that sign data hiding is disabled for a current block if the current block is generated using lossy coding without application of a transform to residual data and the current block is intra predicted using an intra prediction mode in which a residual differential pulse code modulation (DPCM) technique is used.

This application claims the benefit of U.S. Provisional PatentApplication No. 61/805,094, filed Mar. 25, 2013, U.S. Provisional PatentApplication No. 61/809,199, filed Apr. 5, 2013, U.S. Provisional PatentApplication No. 61/809,203, filed Apr. 5, 2013, U.S. Provisional PatentApplication No. 61/809,811, filed Apr. 8, 2013, U.S. Provisional PatentApplication No. 61/809,870, filed Apr. 8, 2013, U.S. Provisional PatentApplication No. 61/810,179, filed Apr. 9, 2013, U.S. Provisional PatentApplication No. 61/810,218, filed Apr. 9, 2013, and U.S. ProvisionalPatent Application No. 61/843,144, filed Jul. 5, 2013, the entirecontent of each of which is incorporated herein by reference.

TECHNICAL FIELD

This disclosure relates to video coding and compression.

BACKGROUND

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, digital direct broadcastsystems, wireless broadcast systems, personal digital assistants (PDAs),laptop or desktop computers, digital cameras, digital recording devices,digital media players, video gaming devices, video game consoles,cellular or satellite radio telephones, video teleconferencing devices,and the like. Digital video devices implement video compressiontechniques, such as those described in the standards defined by MPEG-2,MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4, Part 10, Advanced Video Coding(AVC), the High Efficiency Video Coding (HEVC) standard, and extensionsof such standards, to transmit, receive and store digital videoinformation more efficiently.

Video compression techniques perform spatial (intra-picture) predictionand/or temporal (inter-picture) prediction to reduce or removeredundancy inherent in video sequences. For block-based video coding, avideo slice may be partitioned into video blocks, which may also bereferred to as treeblocks, coding units (CUs) and/or coding nodes. Videoblocks in an intra-coded (I) slice of a picture are encoded usingspatial prediction with respect to reference samples in neighboringblocks in the same picture. Video blocks in an inter-coded (P or B)slice of a picture may use spatial prediction with respect to referencesamples in neighboring blocks in the same picture or temporal predictionwith respect to reference samples in other reference pictures. Picturesmay be referred to as frames, and reference pictures may be referred toas reference frames.

SUMMARY

In general, a video encoder may generate a bitstream that includes asequence of bits that forms a coded representation of the video data. Aspart of generating the bitstream, the video encoder may determine thatsign data hiding is disabled for a current block if the current block isgenerated using lossy coding without application of a transform toresidual data and the current block is intra predicted using an intraprediction mode in which a residual differential pulse code modulation(DPCM) technique is used. Similarly, a video decoder may obtain syntaxelements from a bitstream that includes a sequence of bits that form acoded representation of the video data. As part of obtaining the syntaxelements from the bitstream, the video decoder may determine that signdata hiding is disabled for a current block if the current block isgenerated using lossy coding without application of a transform toresidual data and the current block is intra predicted using an intraprediction mode in which a residual DPCM technique is used. The videodecoder may reconstruct a picture of the video data based at least inpart on the syntax elements obtained from the bitstream.

In one example, this disclosure describes a method of decoding videodata, the method comprising: obtaining syntax elements from a bitstreamthat includes a sequence of bits that form a coded representation of thevideo data, wherein obtaining the syntax elements from the bitstreamcomprises determining that sign data hiding is disabled for a currentblock if the current block is generated using lossy coding withoutapplication of a transform to residual data and the current block isintra predicted using an intra prediction mode in which a residualdifferential pulse code modulation (DPCM) technique is used; andreconstructing a picture of the video data based at least in part on thesyntax elements obtained from the bitstream.

In another example, this disclosure describes a method of encoding videodata, the method comprising: generating a bitstream that includes asequence of bits that forms a coded representation of the video data,wherein generating the bitstream comprises determining that sign datahiding is disabled for a current block if the current block is generatedwithout application of a transform to residual data and the currentblock is intra predicted using an intra prediction mode in which aresidual differential pulse code modulation (DPCM) technique is used;and outputting the bitstream.

In another example, this disclosure describes a video coding apparatuscomprising: a memory that stores data; and one or more processorsconfigured to determine that sign data hiding is disabled for a currentblock if the current block is generated using lossy coding withoutapplication of a transform to residual data and the current block isintra predicted using an intra prediction mode in which a residualdifferential pulse code modulation (DPCM) technique is used.

In another example, this disclosure describes a video decoding apparatuscomprising: means for obtaining syntax elements from a bitstream thatincludes a sequence of bits that form a coded representation of thevideo data, wherein obtaining the syntax elements from the bitstreamcomprises determining that sign data hiding is disabled for a currentblock if the current block is generated using lossy coding withoutapplication of a transform to residual data and the current block isintra predicted using an intra prediction mode in which a residualdifferential pulse code modulation (DPCM) technique is used; and meansfor reconstructing a picture of the video data based at least in part onthe syntax elements obtained from the bitstream.

In another example, this disclosure describes a video encoding apparatuscomprising: means for generating a bitstream that includes a sequence ofbits that forms a coded representation of the video data, whereingenerating the bitstream comprises determining that sign data hiding isdisabled for a current block if the current block is generated usinglossy coding without application of a transform to residual data and thecurrent block is intra predicted using an intra prediction mode in whicha residual differential pulse code modulation (DPCM) technique is used;and means for outputting the bitstream.

In another example, this disclosure describes a non-transitorycomputer-readable data storage medium having instructions stored thereonthat, when executed, cause one or more processors to: determine thatsign data hiding is disabled for a current block if the current block isgenerated using lossy coding without application of a transform toresidual data and the current block is intra predicted using an intraprediction mode in which a residual differential pulse code modulation(DPCM) technique is used.

The details of one or more examples of the disclosure are set forth inthe accompanying drawings and the description below. Other features,objects, and advantages will be apparent from the description, drawings,and claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example video coding systemthat may utilize the techniques of this disclosure.

FIG. 2 is a conceptual diagram illustrating a block of size M (height)×N(width).

FIG. 3 is a conceptual diagram illustrating example intra predictionmode directions.

FIG. 4 is a conceptual diagram illustrating exemplary samples that maybe used for prediction in video coding.

FIG. 5A shows a residual differential pulse code modulation (DPCM)direction for near-vertical modes.

FIG. 5B shows a residual DPCM direction for near-horizontal modes.

FIG. 6 is a block diagram illustrating an example video encoder that mayimplement the techniques of this disclosure.

FIG. 7 is a block diagram illustrating an example video decoder that mayimplement the techniques of this disclosure.

FIG. 8A is a flowchart illustrating an example operation of a videoencoder, in accordance with one or more techniques of this disclosure.

FIG. 8B is a flowchart illustrating an example operation of a videoencoder, in accordance with one or more techniques of this disclosure.

FIG. 9A is a flowchart illustrating an example operation of a videodecoder, in accordance with one or more techniques of this disclosure.

FIG. 9B is a flowchart illustrating an example operation of a videodecoder, in accordance with one or more techniques of this disclosure.

FIG. 10A is a flowchart illustrating an example video encoder operationfor sign data hiding, in accordance with one or more techniques of thisdisclosure.

FIG. 10B is a flowchart illustrating an example video decoder operationfor sign data hiding, in accordance with one or more techniques of thisdisclosure.

DETAILED DESCRIPTION

In general, this disclosure describes techniques for improving intraprediction in High Efficiency Video Coding (HEVC) and other video codingstandards. Intra prediction is a process of generating, based on samplevalues in a current picture, a predictive block for a video block of thecurrent picture. Thus, when a video block of a current picture isencoded using intra prediction, the video encoder does not use samplevalues from other pictures to generate or otherwise identify thepredictive block for the video block.

After generating a predictive block, a video encoder may use thepredictive block to determine a block of residual samples (i.e., aresidual block). Residual samples in the residual block may indicate thedifference between samples in the predictive block and correspondingoriginal samples of the video block. The video encoder may generate atransform coefficient block by applying a transform to the residualblock. The transform may convert the residual samples from a pixeldomain to a transform domain. The video encoder may then quantize thetransform coefficients in the transform coefficient block to reduce thebit depths of the transform coefficients. The video encoder may entropyencode syntax elements representing the quantized transform coefficientsand include the resulting entropy encoded syntax elements in abitstream.

A video decoder may perform an inverse of this process. That is, thevideo decoder may entropy decode syntax elements in the bitstream todetermine quantized transform coefficients. The video decoder may theninverse quantize the quantized transform coefficients to determine thetransform coefficients. Furthermore, the video decoder may apply aninverse transform to the transform coefficients to determine theresidual block. In addition, the video decoder may determine apredictive block (e.g., using intra prediction). The video decoder mayuse samples in the predictive block and corresponding residual samplesin the residual block to reconstruct samples of the video block.

The application of the transform and the use of quantization causesinformation loss. Thus, the samples of a video block reconstructed bythe video decoder may not have the same level of precision as theoriginal samples of the video block. Accordingly, application of thetransform and use of quantization may be a form of “lossy” coding. Insome instances, the video encoder may encode a video block usinglossless encoding. When the video encoder encodes a video block usinglossless encoding, the video encoder does not apply the transform toresidual samples and does not quantize the residual samples. Likewise,the video decoder does not apply inverse quantization or the inversetransform. As a result, the samples of the video block reconstructed bythe video decoder may have the same level of precision as the originalsamples of the video block.

In other instances, the video encoder may perform a type of lossy codingin which the video encoder does not apply a transform to residualsamples, but does quantize the residual samples. Likewise, the videodecoder may apply inverse quantization to the residual samples, but doesnot apply an inverse transform to the residual samples. Because thevideo encoder still applies quantization to the residual samples, thesamples reconstructed by the video decoder may have less precision thanthe original samples, but the precision loss may potentially be lessthan if the transform had been applied.

As indicated above, a video coder (e.g., a video encoder or a videodecoder) may use intra prediction to generate a predictive block. Morespecifically, the video coder uses a particular intra prediction modefrom among a plurality of available intra prediction modes to generatethe predictive block. In HEVC and other video coding standards, theintra prediction modes include a plurality of directional intraprediction modes, a planar intra prediction mode, and a DC intraprediction mode. In general, when the video coder generates a predictiveblock using the planar intra prediction mode, the samples of thepredictive block may be determined based a combination of linearprojections. When the video coder generates a predictive block using theDC intra prediction mode, the video coder may determine a DC intraprediction value. The DC intra prediction value may be an average valueof samples adjacent to a left edge and a top edge of the predictiveblock. The video coder may set each sample value in the predictive blockequal to the DC intra prediction value.

Some techniques of this disclosure provide improvements to the DC intraprediction mode when a video coder uses lossless coding. In losslesscoding, a video encoder may use original values of samples when using DCintra prediction mode to determine values of samples in a predictiveblock. In lossy coding, a video decoder does not have access to theoriginal values of samples when using DC intra prediction to determinevalues of samples in a predictive block. However, in lossless coding,the video decoder does have access to reconstructed values of sampleswhen using DC intra prediction to determine values in the predictiveblock. In lossless coding, the reconstructed values of the samples arethe same as the original values of the samples.

As described herein, the video coder may generate a predictive block. Aspart of generating the predictive block, the video coder may use atleast one of a losslessly reconstructed sample to left of a currentsample in a current row of a predictive block and a losslesslyreconstructed sample for a row of the predictive block above the currentrow for DC prediction of the current sample. Furthermore, in someinstances, this may enable the video decoder to pipeline thedetermination of sample values in the predictive block.

Furthermore, as indicated above, a video encoder may perform a form oflossy coding in which quantization is used but the transform is skipped,which may be referred to as transform skip coding. In accordance withone or more additional techniques of this disclosure, the video encodermay apply a form of residual differential pulse code modulation (DPCM)to prepare the non-transformed, but quantized, residual samples forcoding. This form of residual DPCM is described in detail elsewhere inthis disclosure. In contrast to other proposals for using DPCM in lossyintra coding, this form of residual DPCM described in this disclosuremay increase throughput of the video encoder and/or video decoder.

As indicated above, a video encoder may entropy encode syntax elementsrepresenting quantized transform coefficients. In lossless coding, orlossy coding when the transform is skipped, the same syntax elements maybe used to represent residual samples. In HEVC and other video codingstandards, the syntax elements representing a transform coefficient orresidual sample may include a sign syntax element that indicates whetherthe transform coefficient or residual sample is positive or negative. Insome instances, it may be unnecessary to include sign syntax elements toindicate whether a transform coefficient or residual sample is positiveor negative. Rather, information indicating whether a transformcoefficient or residual sample is positive or negative may be embeddedin values of other syntax elements for the transform coefficient orresidual sample. Embedding such information in values of other syntaxelements, instead of signaling sign syntax elements may be referred toas sign data hiding.

However, sign data hiding may be difficult to implement for blocks thatare coded using lossy coding for which the transform is skipped and aplanar intra prediction mode, a DC intra prediction mode (e.g., a DCintra prediction mode in which reconstructed samples corresponding tosamples in the predictive block are used to determine value ofpredictive samples in the predictive block), or residual DPCM is used.Furthermore, in transform skip coding, sign data hiding may introduceerrors into the residual values that are compounded when residual DPCMis applied. Such errors may propagate to subsequent residual samples,resulting in a degradation of performance. Thus, in accordance with oneor more techniques of this disclosure, sign data hiding may benormatively disabled for such blocks even if one or more syntax elementsindicate that sign data hiding is enabled for such blocks.

For instance, in some examples, the video decoder determines that signdata hiding is disabled for a current block if the current block isgenerated using lossy coding without application of a transform toresidual data and the current block is intra predicted using an intraprediction mode in which residual DPCM is used. In such examples, whensign data hiding is disabled for the current block, the video decodermay obtain, from the bitstream, for each respective significant value inthe block, a respective syntax element indicating whether the respectivesignificant value is positive or negative.

FIG. 1 is a block diagram illustrating an example video coding system 10that may utilize the techniques of this disclosure. As described herein,the term “video coder” refers generically to both video encoders andvideo decoders. In this disclosure, the terms “video coding” or “coding”may refer generically to video encoding or video decoding.

As shown in FIG. 1, video coding system 10 includes a source device 12and a destination device 14. Source device 12 generates encoded videodata. Accordingly, source device 12 may be referred to as a videoencoding device or a video encoding apparatus. Destination device 14 maydecode the encoded video data generated by source device 12.Accordingly, destination device 14 may be referred to as a videodecoding device or a video decoding apparatus. Source device 12 anddestination device 14 may be examples of video coding devices or videocoding apparatuses.

Source device 12 and destination device 14 may comprise a wide range ofdevices, including desktop computers, mobile computing devices, notebook(e.g., laptop) computers, tablet computers, set-top boxes, telephonehandsets such as so-called “smart” phones, televisions, cameras, displaydevices, digital media players, video gaming consoles, in-car computers,or the like.

Destination device 14 may receive encoded video data from source device12 via a channel 16. Channel 16 may comprise one or more media ordevices capable of moving the encoded video data from source device 12to destination device 14. In one example, channel 16 may comprise one ormore communication media that enable source device 12 to transmitencoded video data directly to destination device 14 in real-time. Inthis example, source device 12 may modulate the encoded video dataaccording to a communication standard, such as a wireless communicationprotocol, and may transmit the modulated video data to destinationdevice 14. The one or more communication media may include wirelessand/or wired communication media, such as a radio frequency (RF)spectrum or one or more physical transmission lines. The one or morecommunication media may form part of a packet-based network, such as alocal area network, a wide-area network, or a global network (e.g., theInternet). Channel 16 may include various types of devices, such asrouters, switches, base stations, or other equipment that facilitatecommunication from source device 12 to destination device 14.

In another example, channel 16 may include a storage medium that storesencoded video data generated by source device 12. In this example,destination device 14 may access the storage medium, e.g., via diskaccess or card access. The storage medium may include a variety oflocally-accessed data storage media such as Blu-ray discs, DVDs,CD-ROMs, flash memory, or other suitable digital storage media forstoring encoded video data.

In a further example, channel 16 may include a file server or anotherintermediate storage device that stores encoded video data generated bysource device 12. In this example, destination device 14 may accessencoded video data stored at the file server or other intermediatestorage device via streaming or download. The file server may be a typeof server capable of storing encoded video data and transmitting theencoded video data to destination device 14. Example file serversinclude web servers (e.g., for a website), file transfer protocol (FTP)servers, network attached storage (NAS) devices, local disk drives, andthe like.

Destination device 14 may access the encoded video data through astandard data connection, such as an Internet connection. Example typesof data connections may include wireless channels (e.g., Wi-Ficonnections), wired connections (e.g., DSL, cable modem, etc.), orcombinations of both that are suitable for accessing encoded video datastored on a file server. The transmission of encoded video data from thefile server may be a streaming transmission, a download transmission, ora combination of both.

The techniques of this disclosure are not limited to wirelessapplications or settings. The techniques may be applied to video codingin support of a variety of multimedia applications, such as over-the-airtelevision broadcasts, cable television transmissions, satellitetelevision transmissions, streaming video transmissions, e.g., via theInternet, encoding of video data for storage on a data storage medium,decoding of video data stored on a data storage medium, or otherapplications. In some examples, video coding system 10 may be configuredto support one-way or two-way video transmission to support applicationssuch as video streaming, video playback, video broadcasting, and/orvideo telephony.

In the example of FIG. 1, source device 12 includes a video source 18, avideo encoder 20, and an output interface 22. In some examples, outputinterface 22 may include a modulator/demodulator (modem) and/or atransmitter. Video source 18 may include a video capture device, e.g., avideo camera, a video archive containing previously-captured video data,a video feed interface to receive video data from a video contentprovider, and/or a computer graphics system for generating video data,or a combination of such sources of video data.

Video encoder 20 may encode video data from video source 18. In someexamples, source device 12 directly transmits the encoded video data todestination device 14 via output interface 22. In other examples, theencoded video data may also be stored onto a storage medium or a fileserver for later access by destination device 14 for decoding and/orplayback.

In the example of FIG. 1, destination device 14 includes an inputinterface 28, a video decoder 30, and a display device 32. In someexamples, input interface 28 includes a receiver and/or a modem. Inputinterface 28 may receive encoded video data over channel 16. Displaydevice 32 may be integrated with or may be external to destinationdevice 14. In general, display device 32 displays decoded video data.Display device 32 may comprise a variety of display devices, such as aliquid crystal display (LCD), a plasma display, an organic lightemitting diode (OLED) display, or another type of display device.

FIG. 1 is merely an example and the techniques of this disclosure mayapply to video coding settings (e.g., video encoding or video decoding)that do not necessarily include any data communication between the videoencoding device and the video decoding device. In other examples, datais retrieved from a local memory, streamed over a network, or the like.A video encoding device may encode and store data to memory, and/or avideo decoding device may retrieve and decode data from memory. In manyexamples, the video encoding and decoding is performed by devices thatdo not communicate with one another, but simply encode data to memoryand/or retrieve and decode data from memory.

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable circuitry, such as one or more microprocessors,digital signal processors (DSPs), application-specific integratedcircuits (ASICs), field-programmable gate arrays (FPGAs), discretelogic, hardware, or any combinations thereof. If the techniques areimplemented partially in software, a device may store instructions forthe software in a suitable, non-transitory computer-readable storagemedium and may execute the instructions in hardware using one or moreprocessors to perform the techniques of this disclosure. Any of theforegoing (including hardware, software, a combination of hardware andsoftware, etc.) may be considered to be one or more processors. Each ofvideo encoder 20 and video decoder 30 may be included in one or moreencoders or decoders, either of which may be integrated as part of acombined encoder/decoder (CODEC) in a respective device.

This disclosure may generally refer to video encoder 20 “signaling”certain information. The term “signaling” may generally refer to thecommunication of syntax elements and/or other data used to decode thecompressed video data. Such communication may occur in real- ornear-real-time. Alternately, such communication may occur over a span oftime, such as might occur when storing syntax elements to acomputer-readable storage medium in an encoded bitstream at the time ofencoding, which a video decoding device may then retrieve at any timeafter being stored to this medium.

In some examples, video encoder 20 and video decoder 30 operateaccording to a video compression standard, such as the High EfficiencyVideo Coding (HEVC) standard. A draft of the HEVC standard, referred toas “HEVC Working Draft 6,” is described in Bross et al., “HighEfficiency Video Coding (HEVC) text specification draft 6,” JointCollaborative Team on Video Coding (JCT-VC) of ITU-T SG16 WP3 andISO/IEC JTC1/SC29/WG11, 7th Meeting: Geneva, Switzerland, November,2011, the entire content of which is incorporated herein by reference.As of Apr. 5, 2013, HEVC Working Draft 6 is downloadable fromhttp://phenix.int-evry.fr/jct/doc_end_user/documents/8_San%20Jose/wg11/JCTVC-H1003-v22.zip.Another draft of the HEVC standard, referred to as “HEVC Working Draft9,” is described in Bross et al., “High Efficiency Video Coding (HEVC)text specification draft 9,” Joint Collaborative Team on Video Coding(JCT-VC) of ITU-T SG16 WP3 and ISO/IEC JTC1/SC29/WG11, 11th Meeting:Shanghai, China, October, 2012, the entire content of which isincorporated herein by reference. As of Mar. 24, 2014, HEVC WorkingDraft 9 is downloadable fromhttp://phenix.int-evry.fr/jct/doc_end_user/documents/11_Shanghai/wg11/JCTVC-K1003-v8.zip.Another draft of HEVC, referred to as “HEVC Working Draft 10,” isdescribed in Bross et al., “High Efficiency Video Coding (HEVC) textspecification draft 10 (for FDIS & Consent),” Joint Collaborative Teamon Video Coding (JCT-VC) of ITU-T SG16 WP3 and ISO/IEC JTC1/SC29/WG11,12th Meeting: Geneva, CH, 14-23 Jan. 2013, the entire content of whichis incorporated herein by reference. As of Mar. 24, 2014, HEVC WorkingDraft 10 is available fromhttp://phenix.int-evry.fr/jct/doc_end_user/documents/12_Geneva/wg11/JCTVC-L1003-v20.zip.The techniques of this disclosure, however, are not limited to anyparticular coding standard or technique.

Furthermore, a range extension specification is being developed forHEVC. The range extension specification provides for alternate samplingmodes, such as 4:0:0, 4:2:0, 4:2:2, and 4:4:4 chroma sampling. Flynn etal., “High Efficiency Video Coding (HEVC) Range Extensions textspecification: Draft 3,” Joint Collaborative Team on Video Coding(JCT-VC) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 13thMeeting: Incheon, KR, 18-26 Apr. 2013, (hereinafter, “JCTVC-M1005_v2”)is a draft of the range extension specification for HEVC. As of Mar. 24,2014, JCTVC-M1005_v2 is available athttp://phenix.int-evey.fr/jct/doc_end_user/documents/13_Incheon/pending/JCTVC-M1005-v2.zip.The entire content of JCTVC-M1005_v2 is incorporated herein byreference.

As mentioned briefly above, video encoder 20 encodes video data. Thevideo data may comprise one or more pictures. Each of the pictures is astill image forming part of a video. When video encoder 20 encodes thevideo data, video encoder 20 may generate a bitstream. The bitstream mayinclude a sequence of bits that form a coded representation of the videodata. The bitstream may include coded pictures and associated data. Acoded picture is a coded representation of a picture. The associateddata may include sequence parameter sets (SPSs), picture parameter sets(PPSs), and other syntax structures. A SPS may contain parametersapplicable to zero or more sequences of pictures. A PPS may containparameters applicable to zero or more pictures.

A picture may include three sample arrays, denoted S_(L), S_(Cb) andS_(Cr). S_(L) is a two-dimensional array (i.e., a block) of lumasamples. Luma samples may also be referred to herein as “Y” samples.S_(Cb) is a two-dimensional array of Cb chrominance samples. S_(Cr) is atwo-dimensional array of Cr chrominance samples. Chrominance samples mayalso be referred to herein as “chroma” samples. Cb chrominance samplesmay be referred to herein as “U samples.” Cr chrominance samples may bereferred to herein as “V samples.”

In some examples, video encoder 20 may down-sample the chroma arrays ofa picture (i.e., S_(Cb) and S_(Cr)). For example, video encoder 20 mayuse a YUV 4:2:0 video format, a YUV 4:2:2 video format, or a 4:4:4 videoformat. In the YUV 4:2:0 video format, video encoder 20 may down-samplethe chroma arrays such that the chroma arrays are ½ the height and ½ thewidth of the luma array. In the YUV 4:2:2 video format, video encoder 20may down-sample the chroma arrays such that the chroma arrays are ½ thewidth and the same height as the luma array. In the YUV 4:4:4 videoformat, video encoder 20 does not down-sample the chroma arrays.

To generate an encoded representation of a picture, video encoder 20 maygenerate a set of coding tree units (CTUs). Each of the CTUs may be acoding tree block of luma samples, two corresponding coding tree blocksof chroma samples, and syntax structures used to code the samples of thecoding tree blocks. A coding tree block may be an N×N block of samples.A CTU may also be referred to as a “tree block” or a “largest codingunit” (LCU). The CTUs of HEVC may be broadly analogous to themacroblocks of other standards, such as H.264/AVC. However, a CTU is notnecessarily limited to a particular size and may include one or morecoding units (CUs).

As part of encoding a picture, video encoder 20 may generate encodedrepresentations of each slice of the picture (i.e., coded slices). Togenerate a coded slice, video encoder 20 may encode a series of CTUs.This disclosure may refer to an encoded representation of a CTU as acoded CTU. In some examples, each of the slices includes an integernumber of coded CTUs.

To generate a coded CTU, video encoder 20 may recursively performquad-tree partitioning on the coding tree blocks of a CTU to divide thecoding tree blocks into coding blocks, hence the name “coding treeunits.” A coding block is an N×N block of samples. A CU may be a codingblock of luma samples and two corresponding coding blocks of chromasamples of a picture that has a luma sample array, a Cb sample array anda Cr sample array, and syntax structures used to code the samples of thecoding blocks. In monochrome pictures, or pictures coded using separatecolor planes, a CU may comprise a single coding block of samples andsyntax structures used to code the coding block. Video encoder 20 maypartition a coding block of a CU into one or more prediction blocks. Aprediction block may be a rectangular (i.e., square or non-square) blockof samples on which the same prediction is applied. A prediction unit(PU) of a CU may be a prediction block of luma samples, twocorresponding prediction blocks of chroma samples of a picture, andsyntax structures used to predict the prediction block samples. Videoencoder 20 may generate predictive luma, Cb and Cr blocks for luma, Cband Cr prediction blocks of each PU of the CU. In monochrome pictures,or pictures coded using separate color planes, a CU may comprise asingle coding block of samples and syntax structures used to code thecoding block.

Video encoder 20 may use intra prediction or inter prediction togenerate the predictive blocks for a PU. If video encoder 20 uses intraprediction to generate the predictive blocks of a PU, video encoder 20may generate the predictive blocks of the PU based on decoded samples ofthe picture associated with the PU.

If video encoder 20 uses inter prediction to generate the predictiveblocks of a PU, video encoder 20 may generate the predictive blocks ofthe PU based on decoded samples of one or more pictures other than thepicture associated with the PU. Video encoder 20 may use uni-predictionor bi-prediction to generate the predictive blocks of a PU. When videoencoder 20 uses uni-prediction to generate the predictive blocks for aPU, the PU may have a single motion vector. When video encoder 20 usesuni-prediction to generate the predictive blocks for a PU, the PU mayhave two motion vectors.

After video encoder 20 generates predictive blocks (e.g., luma, Cb andCr blocks) for one or more PUs of a CU, video encoder 20 may generate aresidual block for the CU. For instance, video encoder 20 may generate aluma residual block for the CU. Each sample in the CU's luma residualblock indicates a difference between a luma sample in one of the CU'spredictive luma blocks and a corresponding sample in the CU's originalluma coding block. In addition, video encoder 20 may generate a Cbresidual block for the CU. Each sample in the CU's Cb residual block mayindicate a difference between a Cb sample in one of the CU's predictiveCb blocks and a corresponding sample in the CU's original Cb codingblock. Video encoder 20 may also generate a Cr residual block for theCU. Each sample in the CU's Cr residual block may indicate a differencebetween a Cr sample in one of the CU's predictive Cr blocks and acorresponding sample in the CU's original Cr coding block.

Furthermore, video encoder 20 may use quad-tree partitioning todecompose the residual blocks of a CU into transform blocks. Forinstance, video encoder 20 may use quad-tree partitioning to decomposeluma, Cb, and Cr residual blocks of a CU into luma, Cb, and Cr transformblocks. A transform block may be a rectangular block of samples on whichthe same transform is applied. A transform unit (TU) of a CU may be atransform block of luma samples, two corresponding transform blocks ofchroma samples, and syntax structures used to transform the transformblock samples. Thus, each TU of a CU may be associated with a lumatransform block, a Cb transform block, and a Cr transform block. Theluma transform block associated with the TU may be a sub-block of theCU's luma residual block. The Cb transform block may be a sub-block ofthe CU's Cb residual block. The Cr transform block may be a sub-block ofthe CU's Cr residual block. In monochrome pictures, or pictures encodedusing separate color planes, a TU may comprise a single transform blockand syntax structures used to transform the transform block samples. ATU size may be the size of a transform block of a TU.

Video encoder 20 may apply one or more transforms to a transform blockof a TU to generate a coefficient block for the TU. For instance, videoencoder 20 may apply one or more transforms to a luma transform block ofa TU to generate a luma coefficient block for the TU. A coefficientblock may be a two-dimensional array of transform coefficients. Atransform coefficient may be a scalar quantity. In addition, videoencoder 20 may apply one or more transforms to a Cb transform block of aTU to generate a Cb coefficient block for the TU. Video encoder 20 mayapply one or more transforms to a Cr transform block of a TU to generatea Cr coefficient block for the TU.

After generating a coefficient block (e.g., a luma coefficient block, aCb coefficient block or a Cr coefficient block), video encoder 20 mayquantize the coefficient block. Quantization generally refers to aprocess in which transform coefficients are quantized to possibly reducethe amount of data used to represent the transform coefficients,providing further compression. After video encoder 20 quantizes acoefficient block, video encoder 20 may entropy encode syntax elementsindicating the quantized transform coefficients. For example, videoencoder 20 may perform Context-Adaptive Binary Arithmetic Coding (CABAC)on the syntax elements indicating the quantized transform coefficients.Video encoder 20 may output the entropy-encoded syntax elements in abitstream.

Video decoder 30 may receive a bitstream generated by video encoder 20.In addition, video decoder 30 may parse the bitstream to decode syntaxelements from the bitstream. Video decoder 30 may reconstruct thepictures of the video data based at least in part on the syntax elementsdecoded from the bitstream. The process to reconstruct the video datamay be generally reciprocal to the process performed by video encoder20. For instance, video decoder 30 may use motion vectors of PUs todetermine predictive blocks for the PUs of a current CU. In addition,video decoder 30 may inverse quantize transform coefficient blocksassociated with TUs of the current CU. Video decoder 30 may performinverse transforms on the transform coefficient blocks to reconstructtransform blocks associated with the TUs of the current CU. Videodecoder 30 may reconstruct the coding blocks of the current CU by addingthe samples of the predictive blocks for PUs of the current CU tocorresponding samples of the transform blocks of the TUs of the currentCU. By reconstructing the coding blocks for each CU of a picture, videodecoder 30 may reconstruct the picture.

As indicated above, a video coder, such as video encoder 20 or videodecoder 30, may use intra prediction to generate a predictive block fora current PU. When a video coder uses intra prediction to generate apredictive block for a current PU, the video coder may determine valuesof samples in the predictive block using a set of reference samples. Forinstance, in HEVC intra prediction, already reconstructed samples fromthe top and left side neighboring blocks may be used for prediction.These reconstructed samples may be referred to as reference samples.

FIG. 2 illustrates reference samples of a block for HEVC intraprediction. In other words, FIG. 2 is a conceptual diagram illustratinga block of size M (height)×N (width). In FIG. 2, M indicates rows and Nindicates columns. Furthermore, in FIG. 2, the samples of a block aredenoted by P_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1). In this disclosure,the term “samples” can refer to the original pixel values of an inputcomponent (e.g., R, G, or B in an RGB picture, Y, Cb, or Cr, in YCbCrpictures, etc.) or sample values of a component after applying a colortransform to the input components. In the example of FIG. 2, thereference pixels are denoted by P_(−1,j), where −1≦j<2N and P_(i,−1)where −1≦i<2M.

As shown in the example of FIG. 2, the reference samples may include aset of reference samples left of the current PU and a set of referencesample above the current PU. This disclosure may refer to the set ofreference samples above the current PU as the top predictor. Thisdisclosure may refer to the set of reference samples left of the currentPU as the left predictor. In other words, in HEVC intra prediction,already reconstructed samples from the top and left side neighboringblocks are used for prediction (the “top” neighboring block may also becalled the “above” neighboring block). These samples are referred to asreference samples. In some examples, if reference pixels are notavailable, a video coder using HEVC may use a specific padding processto generate missing reference samples.

When a video coder uses intra prediction to generate a predictive block,the video coder may generate the predictive block according to an intraprediction mode from a plurality of available intra prediction modes.The intra prediction modes may include a plurality of directional (i.e.,angular) intra prediction modes. For instance, in some versions of HEVC,there are 33 directional intra prediction modes. Each of the directionalintra prediction modes corresponds to a different direction. FIG. 3 is aconceptual diagram illustrating example intra prediction modedirections. When the video coder generates a predictive block accordingto a directional intra prediction mode, the video coder may, for eachrespective sample of the predictive block, assign to the respectivesample a value of a reference sample (or a weighted combination ofreference samples) that is aligned with the respective sample in adirection corresponding to the directional intra prediction mode. When avideo coder uses a directional (i.e., angular) intra prediction mode togenerate a predictive block for a current block, the video coder may besaid to be performing angular intra prediction.

Furthermore, in some versions of HEVC, the intra prediction modesinclude a DC intra prediction mode. In such versions of HEVC, when thevideo coder uses DC intra prediction to generate a predictive block, thevideo coder may determine a mean value of the reference samples. Thevideo coder may then determine that each sample in the predictive blockhas the determined mean value. Thus, when the video coder uses DC intraprediction to generate a predictive block, all samples of the predictiveblock have the same value. For example, assume that a padding processhas been completed so that all the reference samples are available. Inthis example, with regard to the 4×4 block shown in the example of FIG.2, the DC prediction may be formed as:

(Σ_(i=0) ³ P _(i,−1)+Σ_(j=0) ³ P _(−1,j)+4)>>3,  (1)

where >> denotes a bitwise right shift operation.

In some versions of HEVC, the intra prediction modes include a planarintra prediction mode. When a video coder generates a predictive blockfor a PU using the planar intra prediction mode, the video coder maydetermine a set of neighboring samples, p[x][y], with x=−1, y=−1 . . .nTbs*2−1 and x=0 . . . nTbS*2−1, y=−1, where nTbS is the size of thecurrent PU. Furthermore, predSamples[x][y] may denote the value of asample at position x, y of the prediction block. The video coder maydetermine the samples of the predictive block as follows:

$\begin{matrix}\left. {{{{{predSamples}\lbrack x\rbrack}\lbrack y\rbrack} = \left( {{\left( {{nTbS} - 1 - x} \right)*{{p\left\lbrack {- 1} \right\rbrack}\lbrack y\rbrack}} + {\left( {x + 1} \right)*{{p\lbrack{nTbS}\rbrack}\left\lbrack {- 1} \right\rbrack}} + {\left( {{nTbs} - 1 - y} \right)*{{p\lbrack x\rbrack}\left\lbrack {- 1} \right\rbrack}} + {\left( {y + 1} \right)*{{p\left\lbrack {- 1} \right\rbrack}\lbrack{nTbS}\rbrack}} + {nTbS}} \right)}\operatorname{>>}{{{(Log}\; 2({nTbS})} + 1}} \right) & (2)\end{matrix}$

In general terms, when planar intra prediction mode is used, the valueof a sample of the predictive block is an average of two linearinterpolations of the value. In the first linear interpolation, asvalues of x increase from left to right across a row of the predictiveblock, a weight accorded to a reference sample left of the row decreaseswhile a weight accorded to a reference sample above and right of atop-right corner of the predictive block increases. In the second linearinterpolation, as values of y increase down a column of the predictiveblock, a weight accorded to a reference sample above the columndiminishes while a weight accorded to a sample below and left of abottom-left corner of the predictive block increases.

In the example of FIG. 2, planar intra prediction may use samplesP_(−1,j), where 0≦j≦(N−1), and P_(M,−1) to generate a bi-linearprediction in the vertical direction. Similarly, samples P_(i,−1), where0≦i≦(M−1), and P_(−1,N) may be used to generate a bi-linear predictionin the horizontal direction. Finally, in this example, the horizontaland vertical predictions may be averaged (or possibly combined withanother mathematical operation). For example, let the planar predictedvalues be denoted by T_(i,j) and assume that the block is square, thatis, M=N. In this example, T_(i,j) may be determined as:

T _(i,j) ^(V)=(M−i)*P _(−1,j) +i*P _(M,−1),

T _(i,j) ^(H)=(N−j)*P _(i,−1) +j*P _(−1,N) and

T _(i,j)=(T _(i,j) ^(V) +T _(i,j) ^(H) +N)>>(log₂ N+1).  (3)

In this example, * denotes product, >> denotes a bitwise right shiftoperation and superscripts H and V denote predictions in the horizontaland vertical directions, respectively.

In some cases, video encoder 20 and video decoder 30 implement alossless coding mode as described herein. Typically, when video encoder20 encodes a block, video encoder 20 transforms (e.g., using a discretecosine transform) and quantizes residual data (i.e., prediction error)for the block. In other words, the prediction error is transformed andquantized. However, when video encoder 20 encodes a block (e.g., a CU)using lossless coding, video encoder 20 may not apply a transform orquantization to residual data for the block. In other words, in losslesscoding mode (e.g., for a CU or an entire picture), the transform andquantization steps may be skipped. Instead, video encoder 20 may treatthe sample values of the residual data in the same manner as quantizedtransform coefficients. For instance, video encoder 20 may entropyencode syntax elements representing sample values of the residual dataand include the resulting data in a bitstream. Thus, the residual datadoes not undergo any loss of information due to transformation orquantization.

Similarly, in some instances where video decoder 30 decodes a block(e.g., a CU) that has been encoded using lossless encoding, videodecoder 30 may not apply inverse quantization or inverse transforms tothe residual data for the block. Instead, video decoder 30 may entropydecode syntax elements representing sample values of the residual dataand then reconstruct sample values of the block based at least in parton sample values of the residual data.

Several example techniques of this disclosure relate to losslessencoding. As described herein, instead of using reference samples fromneighboring blocks for prediction, samples from a current block can beused for improved prediction. For instance, several example techniquesof this disclosure describe modifications that may be applicable to anintra DC prediction mode for lossless coding in the HEVC standard.Furthermore, several example techniques of this disclosure describemodifications that may be applicable to an intra planar prediction modefor lossless coding in the HEVC standard. The techniques of thisdisclosure may also be applicable to other types of prediction, and mayalso be applicable to other coding standards.

In lossless coding, instead of using reference samples from neighboringblocks for prediction, samples from the current block can be used forimproved prediction. For instance, techniques for angular intraprediction for lossy coding modes as well as lossless coding modes whentransform is skipped are set forth in Lan et al., “Intra and intercoding tools for screen contents,” Joint Collaborative Team on VideoCoding (JCT-VC) of ITU-T SG 16 WP3 and ISO/IEC JTC1/SC29/WG11, 5^(th)Meeting, Geneva, CH, 16-23 Mar., 2011, document JCTVC-E145 (hereinafter,“JCTVC-E145”). Furthermore, for lossless coding, transform andquantization steps are skipped, so it may be possible to improve uponthe process for determining samples of a predictive block when using theintra DC mode.

In accordance with one or more techniques of this disclosure, forcalculation of predictive block, it may be assumed that the samples arebeing processed in a raster scan along rows. However, in other examples,the same techniques can be extended to raster scan along columns (oreven to diagonal or zig-zag scans, but losing some potential ofparallelization of the techniques). When no transform or quantization isapplied to the prediction error in lossless mode, it can be assumed thatafter entropy decoding of the prediction error (i.e., residual), theoriginal sample can be reconstructed losslessly. Hence, in the contextof lossless coding, the term “original sample” or “original samplevalue” may refer to either actual original sample values orreconstructed sample values (i.e., non-residual samples). Due to theraster scan along rows, all the samples from previous rows as well asall the samples to the left of the current sample from the current roware available for DC prediction. One or more techniques of thisdisclosure take advantage of this to improve intra prediction using theDC intra prediction mode.

This disclosure describes several example intra prediction modes. Theintra prediction modes of this disclosure can replace the planar intraprediction mode or can be understood as planar intra prediction modes.Thus, the intra prediction modes of this disclosure may replace thecurrent planar mode in HEVC for lossless coding. Details described inthe examples of this disclosure may be combined with one or more detailsof other examples of this disclosure. That is, the details may becombined in any of a wide variety of different ways to achieve stillother examples.

In accordance with some examples of this disclosure where a video coder(e.g., video encoder 20 or video decoder 30) generates a predictiveblock using a DC intra prediction mode, the video coder may processsamples of a predictive block in a raster scan order. When the videocoder processes a sample of the predictive block, the video coder mayuse a causal neighborhood of the sample of the predictive block to forma DC prediction value for the sample. In general, a causal neighborhoodof a sample in a predictive block is a set of reconstructed samples(e.g., non-residual, non-predictive samples) that correspond to samplesin the predictive block that have already been determined. For examples,when using a raster scanning order along rows starting from a top leftsample of the predictive block, the causal neighborhood of a sample inthe predictive block may include reconstructed samples that correspondto locations above and left of the sample. In one such example, when avideo coder generates a predictive block using a DC intra predictionmode, the video coder calculates the DC prediction value, DC_(i,j), fora current sample P_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1), as:

DC _(i,j)=(P _(i,j−1) +P _(i−1,j)+1)>>1.  (4)

or similarly,

DC _(i,j)=(P _(i,j−1) +P _(i−1,j))>>1.  (5)

Thus, in equations (4) and (5), for each respective sample in apredictive block, video encoder 20 may determine a DC intra predictionvalue (i.e., DC_(i,k)) for the respective sample as an average of areconstructed value of a sample above the respective sample (i.e.,P_(i,j−1)) and a reconstructed value of a sample left of the respectivesample (i.e.,P_(i−1,j). Because video encoder 20 is using lossless coding, the reconstructed value of the sample left of the respective sample and the reconstructed value of the sample above respective sample are same as the original values of the sample left of the respective sample and the original value of the sample above the respective sample. Similarly, in equations ()4)and (5), for each respective sample in a predictive block, video decoder30 may determine a DC intra prediction value (i.e., DC_(i,k)) for therespective sample as an average of a reconstructed value of a sampleabove the respective sample (i.e., P_(i,j−1)) and a reconstructed valueof a sample left of the respective sample (i.e., P_(i−1,j)). Becausevideo decoder 30 is using lossless coding, the reconstructed value ofthe sample above the respective sample and the reconstructed value ofthe sample left of the respective sample are the same as the originalvalue of the sample above the respective sample and the original valueof the sample left of the respective sample.

Due to the raster scan and the padding process for reference samples,reconstructed samples P_(i,j−1) and P_(i−1,j) may always be available.In other words, a sample above the current sample and a reference sampleleft of the current sample may always be available. Furthermore, due tothe non-linear nature of the right shifting operation used incalculating the DC_(i,j), prediction value it may be difficult for videodecoder 30 to process multiple samples in parallel. For example,DC_(i,j+1) can be represented as

DC _(i,j+1)=(P _(i,j) +P _(i−1,j+1)+1)>>1, or

DC _(i,j+1)=((R _(i,j)((P _(1,j−1) +P _(i−1,j)+1)>>1)+P_(i−1,j+1)+1)>>1,

In the equations above, R_(i,j) is the prediction residual for sample atlocation (i,j). Because the right bit-shift is non-linear process, theremay be no way to calculate DC_(i,j+1) before finishing the calculationof DC_(i,j). For instance, it may be difficult for video decoder 30 toprocess multiple samples of the predictive block in parallel.

When video decoder 30 decodes a coded representation of a current blockthat is coded using lossless coding, video decoder 30 may obtain, from abitstream, syntax elements indicating residual sample values of thecurrent block. Thus, when the current block is coded using losslesscoding, video decoder 30 does not need apply inverse quantization or aninverse transform to determine the residual sample values of the currentblock. Obtaining the syntax elements from the bitstream may involveentropy decoding the syntax elements. Accordingly, when the currentblock is coded using lossless or lossy coding, it can be assumed thatprediction residuals (i.e., the prediction error) of the current blockhave already been entropy decoded.

Thus, when a current block is coded using lossless or lossy coding, theprediction residuals are available for use in determining thereconstructed values of samples that video decoder 30 uses indetermining the DC prediction values for samples of a predictive blockfor the current block. Assuming that the prediction residuals havealready been entropy decoded, it may be possible to pipeline theprocessing of samples in different rows with a one sample delay. Thus,in accordance with one or more techniques of this disclosure, videodecoder 30 may start processing of a second row of samples after onesample from the first row has been reconstructed. In this way, videodecoder 30 may process multiple rows of samples in parallel. Hence, aspart of generating a predictive block, a video coder may pipelineprocessing of samples in different rows of the predictive block, whereina one cycle delay for DC prediction exists between rows of thepredictive block.

In another example, a video coder (e.g., video encoder 20 or videodecoder 30) may calculate a DC prediction value DC_(i,j), where0≦i≦(M−1) and 0≦j≦(N−1), as:

DC _(i,j)=(P _(i,j−1) +P _(i−1,j) −P _(i−1,j−1)).  (6)

Thus, in this example, for each respective sample of a predictive block,video encoder 20 may determine a DC prediction value (i.e. DC_(i,j)) forthe respective sample as a sum of a reconstructed value of a sampleabove the respective sample (i.e., P_(i,j−1)) and a reconstructed valueof a sample left of the respective sample (i.e., P_(i−1,j)), minus anoriginal value of a sample immediately above and left of the respectivesample (i.e., P_(i−1,j−1)). Similarly, for each respective sample of apredictive block, video decoder 30 may determine a DC prediction value(i.e. DC_(i,j)) for the respective sample as a sum of a reconstructedvalue of a sample above the respective sample (i.e., P_(i,j−1)) and areconstructed value of a sample left of the respective sample (i.e.,P_(i−1,j)), minus a reconstructed value of a sample immediately aboveand left of the respective sample (i.e., P_(i−1,j−1)). Because losslesscoding is being used, the reconstructed value of the samples are thesame as the original values of the samples.

In this example, it may be simpler to process multiple sample values ina row by using additional logic. For example, a video coder cancalculate DC_(i,j+1) for a current sample P_(i,j) of a predictive blockwithout waiting for P_(i,j) as follows. DC_(i,j+1) can be expressed as:

DC _(i,j+1)=((P _(i,j−1) +P _(i−1,j) −P _(i−1,j−1))+r _(i,j) +P_(i−1,j+1) −P _(i−1,j))  (7)

Equation (7) may be rewritten as follows:

DC _(i,j+1)=Σ_(n=0) ^(j) r _(i,j−n) +P _(i−1,j+1) +P _(i,−1) +P_(i−1,−1).  (8)

In equations (7) and (8), r_(i,j) is the prediction error residual forsample P_(i,j). Thus, in this example, the calculation of a DC intraprediction value for a particular sample at location (i,j+1) (i.e.,DC_(i,j+1)) is not dependent on the reconstructed values of the samplesto the left of the particular sample. Rather, the calculation of the DCintra prediction value DC_(i,j+1) for a particular sample may depend onthe reconstructed value for the sample directly above, as well as theresidual values for all the samples to the left of the current sample,and reference samples in the same row and the row above. This may allowvideo decoder 30 (as well as video encoder 20) to calculate the DCprediction values for all the samples in a row of a block in parallelassuming that the residuals for the entire row have already beendecoded.

Because lossless coding is being used, the reconstructed value of thesamples (i.e., P_(i,j−1), P_(i−1,j), and P_(i−1,j−1)) are the same asthe original values of the samples. As further described elsewhere inthis disclosure, this technique may be applied to lossy coding. In thatcase, to maintain parallelization, it is necessary to use unclippedreconstructed value for the sample to the left for DC prediction. Thereconstructed samples from the row above may be clipped or unclipped.For example, for an 8-bit video sequence, the reconstructed samples areclipped to the interval [0, 255].

In another example, left, top-left, top and top-right samples are usedin determining DC intra prediction values. In this example, a videocoder may calculate a DC prediction value DC_(i,j) for a current sampleP_(i,j) of a predictive block, where 0≦i≦(M−1) and 0≦j≦(N−1), as:

DC _(i,j)=(P _(i,j−1) +P _(i−1,j) +P _(i−1,j−1) +P_(i−1,j+1)+2)>>2,  (9)

or similarly,

DC _(i,j)=(P _(i,j−1) +P _(i−1,j) +P _(i−1,j−1) +P _(i−1,j+1))>>2.  (10)

Thus, in the examples of equations (9) and (10), for each respectivesample of a predictive block, a DC intra prediction value for therespective sample (i.e., DC_(i,j)) is an average of the reconstructedsample above the respective sample (i.e., P_(i,j−1)), the reconstructedsample left of the respective sample (i.e., P_(i−1,j)), thereconstructed sample above and left of the respective sample (i.e.,P_(i−1,j−1)), and the reconstructed sample above and right of therespective sample (i.e., P_(i−1,j+1)). Because lossless coding is beingused, the reconstructed values of the samples (i.e., P_(i,j−1),P_(i−1,j), P_(i−1,j−1), and P_(i−1,j+1)) are the same as the originalvalues of the samples.

In examples using equations (9) or (10) to determine DC intra predictionvalues, for the samples in the last column (j=(N−1), i>0), the top-rightsample is not available. To overcome this, a video coder may assume thatthe top and top-right samples (i.e., P_(i−1,j) and P_(i−1,j+1),respectively) have the same value. In another example where a videocoder uses equations (9) or (10) to determine DC intra predictionvalues, the video coder may modify the DC prediction to use onlyavailable samples. In some examples, a sample may be unavailable if thesample is not within the boundaries of a current slice or picture, orhas not yet been coded.

Furthermore, in accordance with another example of this disclosure, avideo coder may perform DC intra prediction on a block size smaller thanthe TU size. For example, irrespective of the TU size, a video coder mayperform the DC intra prediction on 2×2 blocks. The video coder mayprocess the 2×2 blocks of a predictive block in a raster scan order. Inthis example, for samples P_(2i,2j), P_(2i,2j+1), P_(2i+1,2j), andP_(2i+1,2j+1), the video coder calculates the DC intra prediction valuesas:

(P _(2i−1,2j) +P _(2i−1,2j+1) +P _(2i,2j−1) +P _(2i+1,2j−1)+2)>>2,  (11)

or similarly,

(P _(2i−1,2j) +P _(2i−1,2j+1) +P _(2i,2j−1) +P _(2i+1,2j−1))>>2.  (12)

In this example, 0≦i≦((M/2)−1) and 0≦j≦((N/2)−1), where M is the heightof the block and N is the width of the block. Furthermore, in thisexample, it is assumed that M and N are both even. In this example, thevideo coder can process four samples in parallel. In this example, thevideo coder may be able to determine the DC intra prediction values ofeach of the four samples of a 2×2 block in parallel. In similarexamples, the video coder may use 4×4 blocks or 8×8 blocks instead of2×2 blocks.

In accordance with another example of this disclosure, the correlationbetween the residuals after performing normal DC prediction isexploited. For example, let r_(i,j), wherein 0≦i≦(M−1) and 0≦j≦(N−1), bethe prediction residuals after performing DC intra prediction asspecified in HEVC (e.g., HEVC Working Draft 10). For instance, r_(i,j)may be a prediction residual value after performing DC intra predictionas described in equation (1) above, for a 4×4 block In this example, avideo coder may then generate intermediate values s_(i,j), where0≦i≦(M−1) and 0≦j≦(N−1). The video coder may generate the intermediatevalues s_(i,j) as:

s _(i,j) =r _(i,2j) ,s _(i,(j+(N/2))) =r _(i,2j) −r _(i,2j+1)  (13)

In equation (13), above, 0≦i≦(M−1), 0≦j≦((N/2)−1).

The video coder may then generate modified residual values t_(i,j),where 0≦i≦(M−1) and 0≦j≦(N−1), as follows:

t _(i,j) =s _(2i,j) ,t _((i+(M/2)),j) =s _(2i,j) −s _(2i+1,j)  (14)

In equation (14), 0≦i≦((M/2)−1) and 0≦j≦(N−1).

The video encoder may entropy encode the modified residuals, t_(i,j), asdescribed in regular HEVC (e.g., HEVC Working Draft 10). On the decoderside (e.g., at video decoder 30), this process is reversed. For example,video decoder 30 may determine,

s _(2i,j) =t _(i,j) ,s _(2i+1,j) =t _(i,j) −t _((i+(M/2)),j),  (15)

where 0≦i≦((M/2)−1) and 0≦j≦(N−1). Video decoder 30 may also determine,

r _(i,2j) =s _(i,j) ,r _(i,2j+1) =s _(i,j) −s _(i(j+(N/2)),j),  (16)

where 0≦i≦((M−1) and 0≦j≦((N/2)−1). This example assumes that M and Nare both even.

In another example of this disclosure, a potentially better predictorcan be used instead of taking simple difference. For instance, a videocoder may determine s_(i,j) as follows:

s _(i,j) =r _(i,2j+1) ,s _(i,(j+(N/2))) =P _(i,2j)−((P _(i,2j−1) +P_(i,2j+1)+1)>>1)  (17)

t _(i,j) =s _(2i+1,j) ,t _((i+(M/2)),j) =s _(2i,j)−((s _(2i+1,j) +s_(2i+1,j)+1)>>1)  (18)

In equation (17), above, 0≦i≦M, 0≦j<(N/2). In equation (18), above,0≦i<M/2, 0≦j<N.

The techniques described in various other examples of this disclosurecan be applied for improving the DC intra prediction mode in lossycoding when the transform is skipped. In other words, various otherexamples of this disclosure may be applied for improving the DC intraprediction mode when a video encoder does not apply a transform toresidual samples of a transform block, but does quantize the residualsamples of the transform block. For example, in the example described inparagraph [0081] above, a causal neighborhood is used for calculatingthe DC prediction value for the current sample. In this example, insteadof using original sample values for calculating the DC prediction valueas is done in case of lossless coding, reconstructed (quantized) samplevalues in the causal neighborhood may be used. Because application ofthe transform is skipped, the reconstructed values in the causalneighborhood are available. It should be noted that to retainparallelization benefits, the clipping operation is not applied toreconstructed values from the current row until the processing for theentire row is complete. For the row above, either clipped or unclippedreconstructed values may be used.

Similarly, as described in paragraph [0090] above, a TU is divided intosmaller blocks (e.g., 2×2 blocks) and a DC prediction value iscalculated for each smaller block. Instead of using original samplevalues for calculating the DC prediction value as is done in the case oflossless coding, reconstructed (quantized) sample values may be used inthe case of lossy coding where the transform is skipped.

Techniques of lossy coding are described above in this disclosure. Inaccordance with some such techniques, let P_(i,j), where 0≦i≦(M−1) and0≦j≦(N−1), denote original sample values. Furthermore, let Q(P_(i,j))denote a quantized version of P_(i,j). Then, in accordance with anadditional example of this disclosure that uses lossy coding, a videocoder may calculate the DC prediction value DC_(i,j) as:

DC _(i,j)=(Q(P _(i,j−1))+Q(P _(i−1,j))−Q(P _(i−1,j−1)))  (Equ. DC1)

Note that equation DC1 is similar to equation (6), above, except thatthe sample values (i.e., P_(i,j−1), P_(i−1,j), and P_(i−1,j−1)) arequantized and then de-quantized. This disclosure may refer to suchsamples as quantized samples or quantized versions of original samples.Thus, in equation DC1, for each respective sample of a predictive block,the video coder may calculate a DC prediction value for the respectivesample as a sum of a quantized version of the original sample above therespective sample (i.e., Q(P_(i,j−1)) and a quantized version of theoriginal sample left of the respective sample (i.e., Q(P_(i−1,j)), minusa quantized version of the original sample above and left of therespective sample (i.e., Q(P_(i−1,j−1))). In equation DC1, terms of theform Q(P_(i,j)) are reconstructed samples. The video coder may thencalculate the prediction residual as r_(i,j)=P_(i,j)−DC_(i,j). In otherwords, the residual value r_(i,j) is equal to the sample value P_(i,j)minus the corresponding DC intra prediction value DC_(i,j). Thereconstructed residual after quantization and dequantization is denotedby Q(r_(i,j)).

The example described in the previous paragraph may have some desirablethroughput properties on the decoder side. For example, it may bepossible for video decoder 30 to calculate the reconstructed samplevalues for all the samples in a row (or column) of a blocksimultaneously. For instance, video decoder 30 may obtain thereconstructed sample values as:

Q(P _(i,j))=Q(r _(i,j))+DC _(i,j), or

Q(P _(i,j))=(Σ_(n=0) ^(j) Q(r _(i,j−n)))+Q(P _(i−1,j))+Q(P _(i,−1))+Q(P_(i−1,−1))  (Equ. DC2)

In equation DC2, Q(P_(i−1,j)) denotes a reconstructed sample which maybe appropriately clipped. For example, to appropriately clip areconstructed value with an input bit depth of 8, the values ofQ(P_(i−1,j)) are clipped between 0 and 255.

Furthermore, in some examples, it may be possible to use non-clippedversions of Q(P_(i−1,j)). The other values, Q(P_(i−1,−1)) andQ(P_(i,−1)) belong to previously reconstructed blocks and are alreadyclipped. In such examples, the reconstructed sample Q(P_(i−1,j)) inequation DC2 is unclipped but can be clipped appropriately withoutaffecting throughput. The prediction specified in equation DC1 is onlyapproximate if the video decoder uses equation DC2 for reconstruction.The prediction in equation DC1 is only approximate because instead ofQ(P_(i,j−1)), which is a clipped version, an unclipped version is used.In such a case, the unclipped version of Q(P_(i,j−1)) may be used on theencoder side as well to generate the DC prediction to avoid a driftbetween the encoder and the decoder. It is possible to use the clippedversion, but then the samples may have to be reconstructed one by one,thereby affecting throughput. This is because, in that case, equationDC1 may have to be used for reconstruction. This means that thereconstruction of a sample may depend on the completion ofreconstruction of a sample to the left of the sample. It has beendescribed in this disclosure how a row of samples can be reconstructedin parallel. A similar process can be followed for reconstructing allthe samples in a column in parallel. If less parallelism is desired, thesummation term may be broken up into smaller chunks, thereby potentiallyreducing throughput but reducing the average number of additionaloperations needed for reconstructing a sample.

Thus, in at least some of the lossy coding examples described above, avideo coder may generate a predictive block. As part of generating thepredictive block, the video coder may use at least one of a firstreconstructed sample (e.g., Q(P_(i−1,j))) and a second reconstructedsample (e.g., Q(P_(i,j−1))) for DC prediction of a current sample of thepredictive block. The first reconstructed sample may correspond to asample left of the current sample in the current row of the predictiveblock. The second reconstructed sample may correspond to a sample in arow of the predictive block above the current row. The video coder mayreconstruct a coding block what was coded using lossy coding by addingsamples of the predictive block to corresponding residual samples.

Furthermore, in at least some of the lossy coding examples describedabove, the video coder may determine a reconstructed value Q(P_(i,j−i))corresponding to a sample above the current sample. In addition, thevideo coder may determine a reconstructed value Q(P_(i−1,j))corresponding to a sample left of the current sample. The video codermay also determine a reconstructed value Q (P_(i−1,j−1)) correspondingto a sample left and above the current sample. The video coder maycalculate a DC prediction value DC_(i,j) for the current sample P_(i,j)as:

DC _(i,j)=(Q(P _(i,j−1))+Q(P _(i−1,j))−Q(P _(i−1,j−1)))

In at least some of the lossy coding examples described above, the videocoder may, for each respective reconstructed value from amongQ(P_(i,j−1)), Q(P_(i−1,j)), and Q(P_(i−1,j−1)), determine the respectivereconstructed value in one of the following ways. First, the video codermay determine the respective reconstructed value as a dequantizedresidual value for a given sample (e.g., Q(r_(i,j))) plus a DCprediction value for the corresponding sample (e.g., DC_(i,j)). Second,as described in equation DC2, the video coder may determine therespective reconstructed value as a sum of dequantized residual valuesfor samples above the given sample (e.g., Σ_(n=0) ^(j)Q(r_(i,j−n))),plus a reconstructed value corresponding to a sample left of the givensample (e.g., Q(P_(i−1,j))), plus a reconstructed value corresponding toa reference sample above a topmost sample of a column of the predictiveblock containing the given sample (e.g., Q(P_(i,−1))), plus areconstructed value corresponding to a reference sample above a topmostsample of a column of the predictive block left of the given sample(e.g., Q(P_(i−1,−1))). In this example, the given sample corresponds tothe respective reconstructed value. In some such examples, the videocoder may clip the reconstructed value corresponding to the sample leftof the given sample.

Another example of this disclosure proposes a modification to theprediction process for the planar mode. Looking at the equations for theplanar mode (e.g., equation (2)), the vertical prediction may be moreaccurate if the original samples from the last row are used forperforming vertical prediction instead of using P_(M,−1). Similarly, thehorizontal prediction may be more accurate if the original samples fromthe last column are used for performing horizontal prediction instead ofusing P_(−1,N). The use of the original samples in intra planar mode isa basic idea behind one or more examples of this disclosure.

For instance, a video encoder (e.g., video encoder 20) may use HEVCplanar prediction (e.g., planar prediction as described in HEVC WorkingDraft 10) for the last row and column, that is, T_(i,j), where i=(M−1)or j=(N−1). The video coder may subtract the prediction values from theoriginal sample values to generate residuals for the last row andcolumn. That is, the video encoder may determine r_(i,j), where i=(M−1)or j=(N−1). The video encoder may then generate the prediction valuesT_(y), where 0≦i≦(M−2) and 0≦j≦(N−2), as follows:

T _(i,j) ^(V)=(M−i)*P _(−1,j) +i*P _(M−1,j),

T _(i,j) ^(H)=(N−j)*P _(i,−1) +j*P _(i,N−1) and

T _(i,j)=(T _(i,j) ^(V) +T _(i,j) ^(H) +N)>>(log₂ N+1).  (19)

This example assumes that M=N. However, extension of this concept torectangular blocks is straightforward. The video encoder may generatethe remaining residuals, r_(i,j), where 0≦i≦(M−2) and 0≦j≦(N−2), bysubtracting the prediction values from the original sample values. Thevideo encoder may entropy encode the entire block of residuals, r_(i,j),where 0≦i≦(M−1) and 0≦j≦(N−1), as in HEVC (e.g., HEVC Working Draft 10).

In this example, on the decoder side, a video decoder (e.g., videodecoder 30) may entropy decode the entire block of prediction residualsto generate residual values r_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1). Thevideo decoder then may perform HEVC planar prediction for samples in thelast row and column of the block. That is, the video coder may determineT_(i,j), where i=(M−1) or j=(N−1), as specified in HEVC (e.g., HEVCWorking Draft 10). For instance, the video coder may determine T_(i,j)using equation (3), above. Furthermore, in this example, the videodecoder adds residual values for the last row and column to the aboveprediction values to reconstruct the original sample values for the lastrow and column. After that, the video decoder generates the predictionvalues T_(i,j), where 0≦i≦(M−2) and 0≦j≦(N−2), exactly as on the encoderside above. The video decoder adds residual values r_(i,j), where0≦i≦(M−2) and 0≦j≦(N−2), to the prediction values to reconstruct thesample values for the remaining sample positions in the block.

In another example of this disclosure, a video encoder (such as videoencoder 20) uses HEVC planar prediction (e.g., planar prediction asdescribed in HEVC Working Draft 10) for the element on the last row andcolumn, that is, T_(i,j). where i=(M−1) and j=(N−1). In this example,the video encoder subtracts a prediction value for a position from theoriginal sample value for the position to generate a residual value forthat position. The video encoder may then predict the elements of thelast row and column bilinearly as:

T _(M−1,j)=((N−j)*P _(M−1,−1) +j*P _(M−1,N−1))>>(log₂ N),

T _(i,N−1)=((M−i)*P _(−1,N−1) +i*P _(M−1,N−1))>>(log₂ M).  (20)

Furthermore, in this example, the video encoder generates the predictionvalues T_(i,j), where 0≦i≦(M−2) and 0≦j≦(N−2), as follows:

T _(i,j) ^(V)=(M−i)*P _(−1,j) +i*P _(M−1,j),

T _(i,j) ^(H)=(N−j)*P _(i,−1) +j*P _(i,N−1) and

T _(i,j)=(T _(i,j) ^(V) +T _(i,j) ^(H) +N)>>(log₂ N+1).  (21)

In this example, the video encoder generates residual values r_(i,j),where 0≦i≦(M−1) and 0≦j≦(N−1) by subtracting the prediction values fromthe original sample values. Furthermore, in this example, the videoencoder entropy encodes the entire block of residuals, r_(i,j), where0≦i≦(M−1) and 0≦j≦(N−1) as in HEVC (e.g., HEVC Working Draft 10).

Another example of this disclosure provides a refinement on the previousexamples. In this example, the residue distribution due to theprediction techniques of this disclosure tends to be the reverse of thecommon one in video compression when a transform is employed. Commonly,the residue has higher values at lower frequencies, and lower expectedvalues at higher frequencies. For the residue coming from the examplesabove, the last row and column tend to have larger values. An approachto improve performance while taking advantage of the entropy codingmethod designed for the transform residue is to rotate the residuecoming from the prediction in the examples provided above. That is, theresidue is rotated 180 degrees, so the top-left part becomes thebottom-right, and vice versa. Then, this rotated residue is entropycoded. Correspondingly, at the decoder, the residue is obtained and thenrotated 180 degrees.

In other examples of this disclosure, the planar prediction process ismodified as follows. For the first row and column, the prediction isperformed as in the case of HEVC planar mode (e.g., planar mode asdescribed in HEVC Working Draft 10) to generate T_(i,j) and r_(i,j), i=0or j=0. In this example, instead of using the HEVC method (e.g., themethod described in HEVC Working Draft 10, equation (3), etc.) forgenerating the prediction for the first row and column, other methodsare used. For instance, P_(0,0) can be predicted as(P_(—1,0)+P_(0,−1)+1)>>1. The remaining samples in the first column canbe predicted using the left sample in the same row. Similarly, theremaining samples in the first row can be predicted using the abovesample in the same column. For the remaining positions, the planarprediction, T_(i,j), where 1≦i≦(M−1) and 1≦j≦(N−1), is generated asfollows:

T _(i,j) ^(V) =P _(i−1,j) +w _(v)*(P _(i−1,j) −P _(i−2,j)),

T _(i,j) ^(H) =P _(i,j−1) +w _(h)*(P _(i,j−1) −P _(i,j−2)) and

T _(i,j)=(T _(i,j) ^(V) +T _(i,j) ^(H)+1)>>1.  (22)

In equation (22), w_(v) and w_(h) are weights. In some examples, a valueof 0.5 is used for both w_(v) and w_(h) since the value of 0.5 can beimplemented as a bit-shift. The remaining residuals (i.e., r_(i,j),where 1≦i≦(M−1) and 1≦j≦(N−1), are generated by subtracting theprediction values from the original sample values. The entire block ofresiduals (i.e., r_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1)), may be entropycoded as in HEVC (e.g., HEVC Working Draft 10).

In this example, on the decoder side, a video decoder (e.g., videodecoder 30) may entropy decode the entire block of prediction residualsto generate residual values (i.e., r_(i,j), where 0≦i≦(M−1) and0≦j≦(N−1)). Then, the video decoder performs planar prediction forsamples in the first row and column (i.e., T_(i,j), where i=0 or j=0) asspecified in HEVC (e.g., HEVC Working Draft 10) or as described above,by any other method used by the video encoder. Furthermore, in thisexample, the video decoder adds the residual values for the first rowand column to the above prediction values to reconstruct the originalsample values for the first row and column. Subsequently, the videodecoder generates the prediction values (i.e., T_(i,j), where 1≦i≦(M−1)and 1≦j≦(N−1)) exactly as on the encoder side above. In this example,the video decoder adds residual values (i.e., r_(i,j), where 1≦i≦(M−1)and 1≦j≦(N−1)) to the prediction values to reconstruct the sample valuesfor the remaining positions in the block.

The paragraphs above describe a different way of performing planarprediction for lossless coding. In an additional example of thisdisclosure, the rightmost column and bottom row are predicted using aplanar prediction procedure as described in the HEVC (e.g., HEVC WorkingDraft 10). In this example, the original sample values for the rightmostcolumn and the bottom row are then used to perform planar or angularprediction for remaining samples of the block. In the case of lossycoding when the transform is skipped, instead of using original samplevalues for the rightmost column and the bottom row, reconstructed(quantized) sample values may be used for performing planar or angularprediction on the remaining samples.

In HEVC (e.g., HEVC Working Draft 10), the DC prediction values for thefirst row and column are filtered (DC prediction filtering). Similarly,for horizontal and vertical intra prediction modes, the first row andcolumn of the prediction values, respectively, are filtered (gradientfiltering). When the methods described above are applied to lossy codingfor DC, horizontal or vertical intra prediction modes, and when thetransform is skipped, the DC prediction filtering or gradient filteringmay be skipped.

In another example of this disclosure, instead of changing the planarprediction mode, the same concept is applied to angular intra predictionmodes. For each angular mode, the last row and column is predicted asspecified in HEVC (e.g., HEVC Working Draft 10, equation (3), etc.).Then, the original sample values for the last row and column are used toperform intra prediction in addition to the reference samples. FIG. 4shows the samples which are used for prediction. The shaded positions inFIG. 4 are the positions used as reference samples for performing theprediction. If, for a specific prediction direction and a specificposition, reference samples P_(−1,j), where N≦j≦2N (or their bilinearinterpolation), would have been used as prediction value, then theoriginal sample values from the right column (i.e., P_(i,N−1), 0≦i≦M−1))are used instead. If the position where the prediction angle interceptsthe rightmost column is a fraction, bilinear interpolation or any othersuitable interpolation method may be used. As an example, consider a 4×4block. For intra prediction mode 34, for sample (2, 2), thecorresponding reference sample would be P-_(1,6). Thus, for mode 34, theHEVC prediction would be T_(2,2)=P_(−1,5). Instead, in this example,T_(2,2)=P_(1,3).

Similarly, if for a specific prediction direction and a specificposition, reference samples P_(i,−1), M≦i≦2M (or their bilinearinterpolation) would have been used as prediction values, then theoriginal sample values from the bottom row (i.e., P_(M−1,j), 0≦j≦N−1)are used instead. If the position where the prediction angle interceptsthe bottom row is a fraction, bilinear interpolation or another suitableinterpolation technique may be used. As an example, consider a 4×4block. In this example, for intra prediction mode 2, for sample (2, 1),the corresponding reference sample is P_(4,−1). Thus, the HEVCprediction for mode 2 would be T_(2,1)=P_(4,−1). Instead, in thisexample, T_(2,1)=P_(3,0).

In some additional examples of this disclosure, video encoder 20 andvideo decoder 30 may perform coding that uses one or more originalsample values within a block of video data to perform prediction ofother sample values within the block. The original sample values maycorrespond to a last row and a last column of the block (e.g., thebottom row and the right most column of the block). As another example,original sample values may correspond to a first row and a first columnof the block (e.g., the top row and the left most column). FIG. 4illustrates one example of sample values used to perform prediction ofother sample values. In this example, the video coder may perform alossless coding mode, and the lossless coding mode may comprise a planarcoding mode, an angular intra coding mode, or another mode. In someexamples, the techniques may further include a rotate operation on setof residual values generated by the prediction, followed by entropycoding with respect to the rotated set of residual values.

Methods of differential pulse code modulation (DPCM) are proposed in Leeet al., “AHG7: Residual DPCM for HEVC lossless coding,” JointCollaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP 3 andISO/IEC JTC 1/SC 29/WG 11, 12^(th) Meeting, Geneva, CH, 14-23 Jan. 2013,document no. JCTVC-L0117 (hereinafter, “JCTVC-L0117”). JCTVC-L0117proposed an improvement to intra prediction for horizontal (e.g., intraprediction mode 10) and vertical (e.g., intra prediction mode 26) modesin HEVC for lossless coding. This improvement was denoted by residualDPCM. In JCTVC-L0117, residual DPCM is applied when a CU is being codedlosslessly. The basic idea of residual DPCM is to use the upper rowpixel for predicting the current pixel for vertical mode and to use theleft column pixel for predicting the current pixel for vertical mode.

Residual DPCM, as described in JCTVC-L0117, can be described as follows.Consider a block of size M (rows)×N (cols). Let r_(i,j), where 0≦i≦(M−1)and 0≦j≦(N−1), be the prediction residual after performing intraprediction as specified in HEVC Working Draft 10. This is shown in FIGS.5A and 5B. The block could represent any component (e.g. luma, chroma,R, G, B, etc.). In the method proposed in JCTVC-L0117, the residual DPCMis applied to the residual samples, so that the modified M×N array{tilde over (R)} with elements {tilde over (r)}_(i,j) is obtained asfollows when the intra prediction mode is vertical:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j} - r_{{({i - 1})},j,}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.} & (23)\end{matrix}$

When the intra prediction mode is horizontal, {tilde over (r)}_(i,j) isobtained as follows:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - r_{i,{({j - 1})}}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.} & (24)\end{matrix}$

The modified residual samples of {tilde over (R)} are signaled to thevideo decoder, instead of the original residual samples R. This may beequivalent to using P_(i−1,j) as a prediction for P_(i,j) for thevertical prediction mode and using P_(i,j−1) as a prediction for P_(i,j)for the horizontal prediction mode.

Furthermore, in the method proposed in JCTVC-L0117, at the decoder side,when the intra prediction mode is a vertical mode, the original residualsamples can be reconstructed after the modified residual samples areparsed as follows:

$\begin{matrix}{{r_{i,j} = {\sum\limits_{k = 0}^{i}{\overset{\sim}{r}}_{k,j}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)},} & (25)\end{matrix}$

When the intra prediction mode is a horizontal mode, the originalresidual samples can be reconstructed after the modified residualsamples are parsed as follows:

$\begin{matrix}{{r_{i,j} = {\sum\limits_{k = 0}^{j}{\overset{\sim}{r}}_{i,k}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq {\left( {N - 1} \right).}}} & (26)\end{matrix}$

Furthermore, this disclosure discusses methods for extending theresidual DPCM techniques proposed in JCTVC-L0117 for horizontal andvertical intra prediction modes to other angular intra prediction modesfor lossless coding. Because the coding is lossless, the originalneighboring samples (in causal coding order) as well as thecorresponding prediction residuals are available for prediction (becausetransform and quantization are skipped).

In a first example, the residual DPCM technique may be extended to otherangular intra prediction modes. FIG. 3 shows the intra predictiondirections for different angular prediction modes (from 2 to 34). Nowconsider a mode between 22 and 30. For each of these modes, theprediction direction can be considered to be close to vertical(near-vertical). The numbers 22 and 30 are just examples. Other ranges(e.g., intra prediction modes between 24 and 28) may be chosen as well.Now consider that the residual r_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1),is calculated as specified in HEVC (e.g., HEVC Working Draft 10). Thatis, the prediction is performed according to the angular mode and issubtracted from the original sample values to get the residual r_(i,j).The residual DPCM may be applied to the residual samples exactly as inJCTVC-L0117 to obtain the modified M×N array R with elements as follows:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j} - r_{{({i - 1})},j,}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.} & (27)\end{matrix}$

Similarly, in this first example, consider a directional intraprediction mode between 6 and 14. For each of these intra predictionmodes, the prediction direction can be considered to be close tohorizontal (i.e., near-horizontal). The numbers 6 and 14 are justexamples. In other examples, other ranges (e.g., intra prediction modesbetween 8 and 12) may be used. Now, consider that the residual r_(i,j),where 0≦i≦(M−1) and 0≦j≦(N−1) is calculated as specified in HEVC (e.g.,HEVC Working Draft 10). That is, the prediction is performed accordingto the angular mode and the prediction is subtracted from the originalsample values to determine the residual r_(i,j). The residual DPCM isapplied to the residual samples exactly as in JCTVC-L0117 to obtain themodified M×N array {tilde over (R)} with elements {tilde over (r)}_(i,j)as follows:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - r_{i,{({j - 1})}}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.} & (28)\end{matrix}$

As in the case of JCTVC-L0117, the modified residual samples of {tildeover (R)} are signaled to the decoder.

Furthermore, in this first example, at the decoder side, the originalresidual samples can be reconstructed after the modified residualsamples are parsed as follows. When the intra prediction mode isnear-vertical (e.g., modes 22 to 30, inclusive), the original residualsamples can be reconstructed as:

$\begin{matrix}{{r_{i,j} = {\sum\limits_{k = 0}^{i}{\overset{\sim}{r}}_{k,j}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)},} & (29)\end{matrix}$

When the intra prediction mode is near-horizontal (e.g., modes 6 to 14,inclusive), the original residual samples can be reconstructed as:

$\begin{matrix}{{r_{i,j} = {\sum\limits_{k = 0}^{j}{\overset{\sim}{r}}_{i,k}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq {\left( {N - 1} \right).}}} & (30)\end{matrix}$

Once the residual r_(i,j) has been calculated, the residual r_(i,j) isadded to the prediction performed according to the angular mode toobtain the original samples. When obtaining the prediction forhorizontal and vertical modes it may be possible to enable or disablethe addition of a gradient term to the prediction for the first column(for vertical mode) or the first row (for horizontal mode).

In a second example where residual DPCM techniques are extended toangular intra prediction modes for lossless coding, for intra predictionmode 18 or intra prediction modes with prediction directions close tothe diagonal down-right prediction direction of intra prediction mode 18(see FIG. 3), the residual may be modified in the following way. First,the residual r_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1), may be calculatedas specified in HEVC Working Draft 10. That is, the prediction may beperformed according to the angular mode and the prediction may besubtracted from the original sample values to get the residual r_(i,j).Then, a modified M×N array {tilde over (R)} with elements {tilde over(r)}_(i,j) may be determined as follows:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - r_{{i - 1},{j - 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.} & (31)\end{matrix}$

In this second example, the modified residual samples of {tilde over(R)} are signaled to the decoder (e.g., video decoder 30). At thedecoder side, the video decoder may reconstruct original residualsamples after the video decoder parses the modified residual samples asfollows. When the intra prediction direction is close to diagonaldown-right prediction direction, the video decoder may reconstruct theoriginal residual samples as:

$\begin{matrix}{r_{i,j} = \left\{ {\begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i - 1},{j - 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.} & (32)\end{matrix}$

Furthermore, in this second example, once the residual r_(i,j) beencalculated, r_(i,j) may be added to the prediction performed accordingto the angular mode to obtain the original samples. In calculatingresidual r_(i,j), r_(i−1,j−1) may need to be available. This may alwaysbe true if the true residuals are calculated row-by-row orcolumn-by-column. Thus, it may be possible to calculate the trueresidual r_(i,j) for all the samples in a row (or column) in parallel.

In a third example where residual DPCM techniques are extended toangular intra prediction modes for lossless coding, for intra predictionmode 34 or intra prediction modes with prediction directions close tothe diagonal down-left prediction direction of intra prediction mode 34(see FIG. 3), the residual may be modified in the following way. First,the residual r_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1), may be calculatedas specified in HEVC (e.g., HEVC Working Draft 10). That is, theprediction may be performed according to the angular mode and theprediction may be subtracted from the original sample values todetermine the residual r_(i,j). Then, a modified M×N array {tilde over(R)} with elements {tilde over (r)}_(i,j) may be determined as follows:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = \left( {N - 1} \right)}} \\{r_{i,j} - r_{{i - 1},{j + 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 2} \right)}}\end{matrix}.} \right.} & (33)\end{matrix}$

Furthermore, in this third example, the modified residual samples of{tilde over (R)} may be signaled to a video decoder (e.g., video decoder30). At the decoder side, the video decoder may reconstruct originalresidual samples after the video decoder parses the modified residualsamples as follows. When the intra prediction direction is close todiagonal down-left prediction direction (mode 34), the video decoder mayreconstruct the original residual samples using the following equation:

$\begin{matrix}{r_{i,j} = \left\{ {\begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i - 1},{j + 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 2} \right)}}\end{matrix}.} \right.} & (34)\end{matrix}$

In this third example, once the residual r_(i,j) has been calculated,r_(i,j) may be added to the prediction performed according to theangular mode to obtain the original samples. In calculating residualr_(i,j), r_(i−1,j+1) may need to be available. This may always be trueif the true residuals are calculated row-by-row. Thus, it may bepossible to calculate the true residual r_(i,j) for all the samples in arow in parallel.

In a fourth example where residual DPCM techniques are extended toangular intra prediction modes for lossless coding, for intra predictionmode 2 or intra prediction modes with prediction directions close to thediagonal up-right prediction direction of mode 2 (see FIG. 3), theresidual may be modified in the following way. First, the residualr_(i,j) where 0≦i≦(M−1) and 0≦j≦(N−1) may be calculated as specified inHEVC (e.g., HEVC Working Draft 10). That is, the prediction may beperformed according to the angular mode and the prediction may besubtracted from the original sample values to determine the residualr_(i,j). Then, a modified M×N array {tilde over (R)} with elements{tilde over (r)}_(i,j) may be determined as follows:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{0 \leq i \leq \left( {M - 2} \right)},{j = 0}} \\{r_{i,j} - r_{{i + 1},{j - 1},}} & {{0 \leq i \leq \left( {M - 2} \right)},{1 \leq j \leq {\left( {N - 1} \right).}}}\end{matrix} \right.} & (35)\end{matrix}$

In this fourth example, the modified residual samples of {tilde over(R)} may be signaled to a video decoder (e.g., video decoder 30). At thedecoder side, the video decoder may reconstruct the original residualsamples after the video decoder parses the modified residual samples asfollows. When the intra prediction direction is close to diagonalup-right prediction direction (mode 2), the video decoder mayreconstruct the original residual samples according to the followingequation:

$\begin{matrix}{r_{i,j} = \left\{ \begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{0 \leq i \leq \left( {M - 2} \right)},{j = 0}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i + 1},{j - 1},}} & {{0 \leq i \leq \left( {M - 2} \right)},{1 \leq j \leq {\left( {N - 1} \right).}}}\end{matrix} \right.} & (36)\end{matrix}$

Furthermore, in this fourth example, once residual r_(i,j) has beencalculated, the residual r_(i,j) may be added to the predictionperformed according to the angular mode to obtain the original samples.In calculating residual r_(i,j), r_(i+1,j−1) may need to be available.This may always be true if the true residuals are calculatedcolumn-by-column. Thus, it may be possible to calculate the trueresidual r_(i,j) all the samples in a column in parallel. The first,second, third, and fourth examples where residual DPCM techniques areextended to angular intra prediction modes for lossless coding may beemployed simultaneously provided that the range of prediction modes foreach embodiment do not overlap.

As described in a fifth example where residual DPCM techniques areextended to angular intra prediction modes for lossless coding, in theresidual DPCM method proposed in JCTVC-L0117, for vertical mode, theresidual for the first row is not modified. A similar observation istrue for the horizontal mode. In that case, the residual for the firstcolumn is not modified. A similar observation is true for thenear-vertical and near-horizontal modes in case of the first examplewhere residual DPCM techniques are extended to angular intra predictionmodes for lossless coding. The fifth example where residual DPCMtechniques are extended to angular intra prediction modes for losslesscoding proposes to extend the concept of residual DPCM to the first rowfor a vertical or near-vertical intra prediction mode and to the firstcolumn for a horizontal or near-horizontal intra prediction mode.Consider a vertical or near-vertical mode. In this case, first, theresidual r_(i,j), where 0≦i≦(M−1) and 0≦j≦(N−1) may be calculated asspecified in HEVC (e.g., HEVC Working Draft 10). That is, the predictionmay be performed according to the angular mode and the prediction may besubtracted from the original sample values to determine the residualr_(i,j). Then, a modified M×N array {tilde over (R)} with elements{tilde over (r)}_(i,j) may be determined as follows:

{tilde over (r)} _(i,j) =r _(i,j) −r_((i−1),j),0≦i≦(M−1),0≦j≦(N−1).  (37)

In equation (37), r_(−1,j) refers to the residual from the upper block.If the upper block is not available or if the upper block belongs to adifferent LCU, it may not be possible to not perform residual DPCM onthe first row.

In this fifth example, the modified residual samples of {tilde over (R)}may be signaled to the video decoder. At the decoder side, the videodecoder may reconstruct the original residual samples after the videodecoder parses the modified residual samples as follows. When the intraprediction mode is vertical or near-vertical, the original residualsamples may be reconstructed as follows:

$\begin{matrix}{{r_{i,j} = {r_{{- 1},j} + {\sum\limits_{k = 0}^{i}\; {\overset{\sim}{r}}_{k,j}}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq {\left( {N - 1} \right).}}} & (38)\end{matrix}$

A similar strategy may be used for horizontal and near-horizontal modeswhere:

$\begin{matrix}{{{\overset{\sim}{r}}_{i,j} = {r_{i,j} - r_{i,{({j - 1})}}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)},{and}} & (39) \\{{r_{i,j} = {r_{i,{- 1}} + {\sum\limits_{k = 0}^{j}\; {\overset{\sim}{r}}_{i,k}}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq {\left( {N - 1} \right).}}} & (40)\end{matrix}$

This approach may be extended in a similar manner to the second, third,and fourth examples where residual DPCM techniques are extended toangular intra prediction modes for lossless coding as described above.

In a sixth example where residual DPCM techniques are extended toangular intra prediction modes for lossless coding, the residual DPCMmethod proposed in JCTVC-L0117 can also be applied to the DC intra mode(e.g., mode 1 in HEVC) and to the planar mode (e.g., mode 0 in HEVC).For example, the vertical (or horizontal) residue prediction may beapplied after the DC intra prediction is done. Furthermore, the verticaland horizontal residue prediction may both be applied: first apply thevertical (horizontal) DCPM and then apply the horizontal (vertical) DPCMto the output of the first DCPM.

A seventh example where residual DPCM techniques are extended to angularintra prediction modes for lossless coding is similar to the sixthexample where residual DPCM techniques are extended to angular intraprediction modes for lossless coding in that two or more DPCMs can beapplied on the residue. For instance, the two diagonal DPCMs describedin the third and fourth examples where residual DPCM techniques areextended to angular intra prediction modes for lossless coding to theplanar mode, and then the horizontal and vertical DPCM.

Various techniques described in this disclosure may also be extended tolossy intra coding when transform is skipped. For example, in HEVC(e.g., HEVC Working Draft 10), the transform may be skipped for 4×4blocks. In this disclosure, the term “transform skip block” applies to ablock for which application of the transform is skipped. However, theproposed techniques described above where residual DPCM techniques areextended to angular intra prediction modes for lossless coding may beused for higher block sizes if transform is skipped. For example,JCTVC-E145 discussed one way to extend these techniques to lossy intracoding when the transform is skipped. In general, the idea proposed inJCTVC-E145 is that instead of using the reference samples for intraprediction as shown in FIG. 2, reconstructed sample values from causalneighbors can be used to perform intra prediction. However, this can becomputationally costly as the prediction process has to be repeated foreach sample. Furthermore, it is unclear as to how this would work for DCand planar intra prediction modes.

One or more techniques of this disclosure are related to residual DPCMfor lossy coding. For instance, in some examples of this disclosure,near-horizontal and near-vertical intra prediction modes for a block forwhich transform is skipped are considered. In this disclosure, anear-vertical mode may be defined as an intra prediction mode where theprediction direction is near vertical. Examples of near-vertical modesmay be all intra prediction modes between 22 and 30 as shown in FIG. 3.Similarly, a near-horizontal mode may be defined as an intra predictionmode where the prediction direction is near horizontal. Examples ofnear-horizontal intra prediction modes may be all intra prediction modesbetween 6 and 14 as shown in FIG. 3. Furthermore, consider a block ofsize M (rows)×N (cols). Let r_(i,j), where 0≦i≦≦(M−1) and 0≦j≦(N−1), bethe prediction residual after performing intra prediction as specifiedin HEVC (e.g., HEVC Working Draft 10). This is shown in FIGS. 5A and 5B.The block may represent any component (e.g. luma, chroma, R, G, B,etc.).

Specifically, FIG. 5A shows a residual DPCM direction for near-verticalmodes. FIG. 5B shows a residual DPCM direction for near-horizontalmodes. Each respective square in FIGS. 5A and 5B corresponds to arespective residual sample r_(i,j). The vertical arrows in each columnof FIG. 5A show the residual DPCM direction for the near-vertical modes.The horizontal arrows in each row of FIG. 5B show the residual DPCMdirection for the near-horizontal modes. A DPCM direction is a direction(e.g., horizontal or vertical) along with a video coder processessamples when applying residual DPCM.

Furthermore, consider a near-vertical mode and let Q(r_(i,j)), where0≦i≦(M−1) and 0≦j≦(N−1), denote the quantized version of residualr_(i,j). The block of residual values may be denoted as R. In otherwords, residual r_(i,j) undergone quantization and inverse quantization.The residual DPCM may be applied to the residual samples to obtain anM×N array {tilde over (R)} as follows. The modified M×N array {tildeover (R)} with elements {tilde over (r)}_(i,j) may be obtained asfollows when the intra prediction mode is vertical:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{r_{i,j} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)},}\end{matrix} \right.} & (41)\end{matrix}$

When the intra prediction mode is horizontal, {tilde over (r)}_(i,j) maybe obtained as:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - {Q\left( r_{i,{({j - 1})}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq {\left( {N - 1} \right).}}}\end{matrix} \right.} & (42)\end{matrix}$

Thus, in the example above, when the intra prediction mode is verticalor near-vertical, the modified residual values in the leftmost column of{tilde over (R)} are equal to corresponding residual values in theleftmost column of R. For each respective residual value (i.e., r_(i,j))in each column of R to the right of the leftmost column of R, videoencoder 20 may set a corresponding modified residual value {tilde over(r)}_(i,j) equal to the respective residual value (i.e., r_(i,j)) minusa reconstructed residual value corresponding to a residual valueoccurring immediately left of the respective residual value (i.e.,Q(r_(i−1),j))). Similarly, when the intra prediction mode is horizontalor near-horizontal, the modified residual values in the top row of{tilde over (R)} are equal to corresponding residual values in the toprow of R. However, for each respective residual value (i.e., r_(i,j)) ineach row of R below the top row of R, video encoder 20 may set thecorresponding modified residual value (i.e., {tilde over (r)}_(i,j))equal to the respective residual value (i.e., r_(i,j)) minus areconstructed residual value corresponding to a residual value occurringimmediately above the respective residual value (i.e., Q(r_(i,(j−1))).

Furthermore, in this example, the modified residual sample, {tilde over(r)}_(i,j) is quantized to produce a quantized version of the modifiedresidual sample, Q({tilde over (r)}_(i,j)). When the intra predictionmode is vertical, the reconstructed residual sample Q(r_(i,j)) iscalculated as:

$\begin{matrix}{{Q\left( r_{i,j} \right)} = \left\{ \begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{{i - 1},j} \right)}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq {\left( {N - 1} \right).}}}\end{matrix} \right.} & (43)\end{matrix}$

This may also be written as:

${{Q\left( r_{i,j} \right)} = {\sum\limits_{k = 0}^{i}\; {Q\left( {\overset{\sim}{r}}_{k,j} \right)}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq {\left( {N - 1} \right).}}$

Similarly, when the mode is horizontal, the reconstructed residualsample Q(r_(i,j)) is calculated as:

$\begin{matrix}{{Q\left( r_{i,j} \right)} = \left\{ \begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{i,{j - 1}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq {\left( {N - 1} \right).}}}\end{matrix} \right.} & (44)\end{matrix}$

This can also be written as:

${{Q\left( r_{i,j} \right)} = {\sum\limits_{k = 0}^{j}\; {Q\left( {\overset{\sim}{r}}_{i,k} \right)}}},{0 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq {\left( {N - 1} \right).}}$

Thus, when the intra prediction mode is vertical or near-vertical, thereconstructed residual values corresponding to residual values in aleftmost column of R are equal to corresponding quantized versions ofmodified residual values in the leftmost column of {tilde over (R)}.However, for each respective residual value in each column of R to theright of the leftmost column of R, video encoder 20 sets thecorresponding reconstructed residual value equal to the sum of thequantized version of the corresponding modified residual value in {tildeover (R)} (i.e., Q({tilde over (r)}_(i,j))) and the reconstructedresidual value corresponding to the residual value occurring immediatelyto the left of the respective residual value (i.e., Q(r_(i−1,j))).Similarly, when the intra prediction mode is horizontal or nearhorizontal, the reconstructed residual values corresponding to residualvalues in the top row of R are equal to corresponding quantized versionsof modified residual values in the top row of {tilde over (R)}. However,for each respective residual value of R in each row of R below the toprow of R, video encoder 20 may set the corresponding reconstructedresidual value equal to a sum of the quantized version of thecorresponding modified residual value in {tilde over (R)} (i.e.,Q({tilde over (r)}_(i,j))) and a reconstructed residual valuecorresponding to the residual value in R occurring immediately above therespective residual value (i.e., Q(r_(i,j−1))).

On the decoder side, calculations (43), and (44) are repeated to producethe reconstructed residual sample Q(r_(i,j)), where 0≦i≦(M−1) and0≦j≦(N−1). Video decoder 30 may add reconstructed residual sample valuesto the original prediction values to produce reconstructed samplevalues. For example, video decoder 30 may add the reconstructed residualsamples Q(r_(i,j)) to corresponding samples of a predictive block toreconstruct sample values of a current block (e.g., a current CU). Theprocess of determining reconstructed residual values from residualvalues that are encoded using DPCM may be referred to herein as “inverseRDPCM.” Normally, both video encoder 20 and video decoder 30 clip thereconstructed samples to an appropriate bitdepth. However, in this case,the clipping operation is performed after the inverse RDPCM process toreconstruct quantized residuals.

The examples above may be extended in a straightforward manner todiagonal directions as well. For instance, in one example, when theintra prediction direction is close to a diagonal down-right direction(e.g., intra prediction mode 18), {tilde over (r)}_(i,j) may bedetermined as:

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{r_{i,j} - {Q\left( r_{{i - 1},{j - 1}} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.} & (45)\end{matrix}$

The reconstructed residual sample Q(r_(i,j)) may be determined as:

$\begin{matrix}{{Q\left( r_{i,j} \right)} = \left\{ \begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{{i - 1},{j - 1}} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq {\left( {N - 1} \right).}}}\end{matrix} \right.} & (46)\end{matrix}$

Other near-diagonal modes (e.g., modes near down-left (mode 34) and nearup-right (mode 2)) can be treated similarly.

Furthermore, in some examples, instead of applying DPCM to reconstructedresiduals, the DPCM may be applied to bit-shifted versions of thereconstructed residuals. For example, for transform skip blocks, videodecoder 30 may perform, for each sample, a dequantization operation, aleft shift by 7, and then a right shift (e.g., after adding an offset)by (20-bit depth). In this context, bit depth may refer to the number ofbits used to represent a sample value or a transform coefficient. In adequantization operation, there is a right shift by bdShift after addingan offset.

For example, section 8.6.2 of JCTVC-M1005_v2 (i.e., a draft of the rangeextension specification for HEVC) describes a scaling and transformationprocess that determines an array of residual samples based on an arrayof transform coefficient levels of a transform block of a TU. In section8.6.2 of JCTVC-M1005_v2, the array of transform coefficient levels maycontain residual sample values if the transform and quantization is notapplied to the transform block. A portion of section 8.6.2 ofJCTVC-M1005_v2 is reproduced below.

The (nTbS)x(nTbS) array of residual samples r is derived as follows:

-   -   If cu_transquant_bypass_flag is equal to 1, the (nTbS)x(nTbS)        array r is set equal to the (nTbS)x(nTbS) array of transform        coefficients TransCoeffLevel[xTbY][yTbY][cIdx].    -   Otherwise, the following ordered steps apply:        -   1. The scaling process for transform coefficients as            specified in subclause 8.6.3 is invoked with the transform            block location (xTbY, yTbY), the size of the transform block            nTbS, the color component variable cIdx, and the            quantization parameter qP as inputs, and the output is an            (nTbS)x(nTbS) array of scaled transform coefficients d.        -   2. The (nTbS)x(nTbS) array of residual samples r is derived            as follows:            -   If transform_skip_flag[xTbY][yTbY][cIdx] is equal to 1,                the residual sample array values r[x][y] with x=0 . . .                nTbS−1, y=0 . . . nTbS−1 are derived as follows:

r[x][y]=(d[x][y]<<7)  (8-267)

-   -   -   -   Otherwise (transform_skip_flag[xTbY][yTbY][cIdx] is                equal to 0), the transformation process for scaled                transform coefficients as specified in subclause 8.6.4                is invoked with the transform block location (xTbY,                yTbY), the size of the transform block nTbS, the color                component variable cIdx, and the (nTbS)x(nTbS) array of                scaled transform coefficients d as inputs, and the                output is an (nTbS)x(nTbS) array of residual samples r.

        -   3. The variable bdShift is derived as follows:

bdShift=(cIdx==0) ? 20−BitDepth_(Y): 20−BitDepth_(C)  (8-268)

-   -   -   4. The residual sample values r[x][y] with x=0 . . . nTbS−1,            y=0 . . . nTbS−1 are modified as follows:

r[x][y]=(r[x][y]+(1<<(bdShift−1)))>>bdShift  (8-269)

As shown above, section 8.6.2 of JCTVC-M1005_v2 specifies that section8.6.3 of JCTVC-M1005_v2 is invoked if the transform and quantization isapplied to the transform block. Section 8.6.3 of JCTVC-M1005_v2describes a scaling process for transform coefficients. Section 8.6.3 ofJCTVC-M1005_v2 is reproduced below.

-   -   Inputs to this process are:        -   a luma location (xTbY, yTbY) specifying the top-left sample            of the current luma transform block relative to the top-left            luma sample of the current picture,        -   a variable nTbS specifying the size of the current transform            block,        -   a variable cIdx specifying the colour component of the            current block,        -   a variable qP specifying the quantization parameter.    -   Output of this process is the (nTbS)x(nTbS) array d of scaled        transform coefficients with elements d[x][y].    -   The variable bdShift is derived as follows:        -   If cIdx is equal to 0,

bdShift=BitDepth_(Y)+Log 2(nTbS)−5  (8-270)

-   -   Otherwise,

bdShift=BitDepth_(C)+Log 2(nTbS)−5  (8-271)

The list levelScale[ ] is specified as levelScale[k]={40, 45, 51, 57,64, 72} with k=0.5.

For the derivation of the scaled transform coefficients d[x][y] with x=0. . . nTbS−1, y=0 . . . nTbS−1, the following applies:

-   -   The scaling factor m[x][y] is derived as follows:    -   If scaling_list_enabled_flag is equal to 0,

m[x][y]=16  (8-272)

-   -   -   Otherwise (scaling_list_enabled_flag is equal to 1),

m[x][y]=ScalingFactor[sizeId][matrixId][x][y]  (8-273)

-   -   Where sizeId is specified in Table 7-3 for the size of the        quantization matrix equal to (nTbS)x(nTbS) and matrixId is        specified in Table 7-4 for sizeId, CuPredMode[xTbY][yTbY], and        cIdx, respectively.        -   The scaled transform coefficient d[x][y] is derived as            follows:

d[x][y]=Clip3(−32768,32767,((TransCoeffLevel[xTbY][yTbY][cIdx][x][y]*m[x][y]*levelScale[qP%6]<<(qP/6))+(1<<(bdShift−1)))>>bdShift)  (8-274)

As indicated in section 8.6.3 of JCTVC-M1005_v2, video decoder 30 maydetermine a scaled transform coefficient, d[x][y], using equation 8-274of JCTVC-M1005_v2. In equation 8-274, the Clip3( . . . ) function isdefined as:

${{Clip}\; 3\left( {x,y,z} \right)} = \left\{ \begin{matrix}{x;} & {z < x} \\{y;} & {z > y} \\{z;} & {{otherwise}.}\end{matrix} \right.$

In accordance with one or more techniques of this disclosure, instead ofapplying the inverse DPCM to the reconstructed residuals, the inverseDPCM may be applied to the dequantized sample values before applying theleft-shift. Similarly, instead of an inverse transform, a left shift by7 may be applied after dequantization. For instance, an array ofresidual samples r[x][y] with x=0 . . . nTbs−1, y=0 . . . nTbS−1 may bederived as shown in equation 8-267 of JCTVC-M1005_v2.

In some examples, the inverse DPCM is applied to samples afterdequantization or after left shift by 7. Similarly, a right shift by(20−bit depth) after adding an offset is applied at the very end of theprocess to reconstruct the residuals. For instance, the residual samplesr[x][y], with x=0 . . . nTbS−1 and y=0 . . . nTbS−1, may be modified asshown in equation 8-269 of JCTVC-M1005_v2.

In that case, the inverse DPCM may be applied after right shifting by anamount less than (20−bit depth) to retain better precision, beforeapplying the remaining right shift so that the overall right shiftamounts to (20−bit depth).

In some instances, video encoder 20 does not apply a transform toresidual samples of a transform block, but does quantize the residualsamples of the transform block. In other words, video encoder 20 mayapply a form of lossy coding in which the transform is skipped. In suchinstances, video decoder 30 may determine, from syntax elements in abitstream, quantized residual samples of the transform block anddequantize the quantized residual samples of the transform block toreconstruct the residual samples of the transform block without applyingan inverse transform to the transform block.

Alternatively, gradient filtering may be modified as described hereinusing reconstructed (quantized) sample values instead of original samplevalues. In HEVC (e.g., HEVC Working Draft 10), when obtaining theprediction for horizontal and vertical modes, a gradient term is addedto the prediction for the first column (for vertical mode) or the firstrow (for horizontal mode). This may be referred to as gradientfiltering. The addition of the gradient term could be enabled ordisabled when using residual DPCM. This disclosure proposes improvementsto the gradient filtering for horizontal and vertical intra predictionmodes when residual prediction is used.

For instance, consider that residual DPCM as proposed in JCTVC-L0117 isbeing used. In HEVC Working Draft 10, for luma components and for blocksizes less than 32, for the vertical intra prediction mode, theprediction for sample P_(i,0), 0≦i≦M−1 is given by:

Clip(P _(−1,0)+((P _(i,−1) −P _(−1,−1))>>1)),

In the equation above, >> represents a bitwise right-shift and the Clipoperation clips the prediction values to the range of sample values.Because in residual DPCM, for vertical intra prediction mode, theprediction for sample P_(i,j) is P_(i−1,j), the gradient term for thesamples in the first column is modified as ((P_(i,−1)−P_(i−1,−1))>>1).Accordingly, the prediction for sample P_(i,0), 0≦i≦M−1 is:

Clip(P _(i−1,0)+((P _(i,−1) −P _(i−1,−1))>>1)).

Furthermore, the gradient filtering may be extended to other columns forvertical intra prediction mode as follows. Because the left and left-toporiginal samples are available in lossless mode, the gradient term maybe added to the prediction for any column in the vertical intraprediction mode. Thus, for vertical intra prediction mode, theprediction for sample P_(i,j), 0≦i≦M−1,0≦j≦N−1 may be modified to:

Clip(P _(i−1,j)+((P _(i,j−1) −P _(i−1,j−1))>>1)).

The modified gradient filtering for vertical intra prediction mode maybe applied to any component and any block size.

This concept may be extended to horizontal intra prediction mode aswell. In HEVC Working Draft 10, for luma components and for block sizesless than 32, for the horizontal intra prediction mode, the predictionfor sample P_(0,j), 0≦j≦N−1 is given by:

Clip(P _(0,−1)+((P _(−1,j) −P _(−1,−1))>>1)),

In the equation above, >> represents a bitwise right-shift and the Clipoperation clips the prediction values to the range of sample values.Because in residual DPCM, for horizontal intra prediction mode, theprediction for sample P_(i,j) is P_(i,j−1), the gradient term for thesamples in the first row may be modified to ((P_(−1,j)−P_(−1,j−1))>>1).The prediction for sample P_(0,j), 0≦j≦N−1 may be determined by:

Clip(P _(0,j−1)+((P _(−1,j) −P _(−1,j−1))>>1)).

The gradient filtering may be extended to other columns for horizontalintra prediction mode as follows. Because the top and left-top originalsamples are always available in lossless mode, the gradient term may beadded to the prediction for any row in the horizontal intra predictionmode. Thus, for horizontal intra prediction mode, the prediction forsample P_(i,j), 0≦i≦M−1, 0≦j≦N−1 may be given by:

Clip(P _(i,j−1)+((P _(i−1,j) −P _(i−1,j−1))>>1)).

As described in section 7.3.2.3 of JCTVC-M1005_v2, a PPS may include asign data hiding enabled syntax element (e.g., sign data hiding enabledflag). Furthermore, as shown in section 7.3.8.11 of JCTVC-M1005_v2, whenthe sign data hiding enabled syntax element has a particular value(e.g., 1), syntax elements (e.g., coeff_sign_flag syntax elements)indicating positive/negative signs of transform coefficients may beomitted from a TU. Thus, video encoder 20 may signal, in a bitstream, anexplicit indication (e.g., a sign_data_hiding_enabled_flag) that signdata hiding is enabled for a current picture and hence a current blockwithin the current picture. Likewise, video decoder 30 may obtain, froma bitstream, an explicit indication (e.g., asign_data_hiding_enabled_flag) that sign data hiding is enabled for acurrent picture and hence a current block in the current picture.Section 7.3.8.11 of JCTVC-M1005_v2 is reproduced below.

Descriptor residual_coding( x0, y0, log2TrafoSize, cIdx ) { if(transform_skip_enabled_flag && !cu_transquant_bypass_flag && (log2TrafoSize == 2 ) ) transform_skip_flag[ x0 ][ y0 ][ cIdx ] ae(v)last_sig_coeff_x_prefix ae(v) last_sig_coeff_y_prefix ae(v) if(last_sig_coeff_x_prefix > 3 ) last_sig_coeff_x_suffix ae(v) if(last_sig_coeff_y_prefix > 3 ) last_sig_coeff_y_suffix ae(v) lastScanPos= 16 lastSubBlock = ( 1 << ( log2TrafoSize − 2 ) ) * ( 1 << (log2TrafoSize − 2 ) ) − 1 do { if( lastScanPos == 0 ) { lastScanPos = 16lastSubBlock−− } lastScanPos−− xS = ScanOrder[ log2TrafoSize − 2 ][scanIdx ][ lastSubBlock ][ 0 ] yS = ScanOrder[ log2TrafoSize − 2 ][scanIdx ][ lastSubBlock ][ 1 ] xC = ( xS << 2 ) + ScanOrder[ 2 ][scanIdx ][ lastScanPos ][ 0 ] yC = ( yS << 2 ) + ScanOrder[ 2 ][ scanIdx][ lastScanPos ][ 1 ] } while( ( xC != LastSignificantCoeffX ) | | ( yC!= LastSignificantCoeffY ) ) for( i = lastSubBlock; i >= 0; i−− ) { xS =ScanOrder[ log2TrafoSize − 2 ][ scanIdx ][ i ][ 0 ] yS = ScanOrder[log2TrafoSize − 2 ][ scanIdx ][ i ][ 1 ] inferSbDcSigCoeffFlag = 0 if( (i < lastSubBlock ) && ( i > 0 ) ) { coded_sub_block_flag[ xS ][ yS ]ae(v) inferSbDcSigCoeffFlag = 1 } for( n = ( i == lastSubBlock ) ?lastScanPos − 1 : 15; n >= 0; n−− ) { xC = ( xS << 2 ) + ScanOrder[ 2 ][scanIdx ][ n ][ 0 ] yC = ( yS << 2 ) + ScanOrder[ 2 ][ scanIdx ][ n ][ 1] if( coded_sub_block_flag[ xS ][ yS ] && ( n > 0 | |!inferSbDcSigCoeffFlag ) ) { sig_coeff_flag[ xC ][ yC ] ae(v) if(sig_coeff_flag[ xC ][ yC ] )  inferSbDcSigCoeffFlag = 0 } }firstSigScanPos = 16 lastSigScanPos = −1 numGreater1Flag = 0lastGreater1ScanPos = −1 for( n = 15; n >= 0; n−− ) { xC = ( xS << 2 ) +ScanOrder[ 2 ][ scanIdx ][ n ][ 0 ] yC = ( yS << 2 ) + ScanOrder[ 2 ][scanIdx ][ n ][ 1 ] if( sig_coeff_flag[ xC ][ yC ] ) { if(numGreater1Flag < 8 ) { coeff_abs_level_greater1_flag[ n ] ae(v)numGreater1Flag++ if( coeff_abs_level_greater1_flag[ n ] &&lastGreater1ScanPos == −1 ) lastGreater1ScanPos = n } if( lastSigScanPos== −1 ) lastSigScanPos = n firstSigScanPos = n } } signHidden = (lastSigScanPos − firstSigScanPos > 3 && !cu_transquant_bypass_flag ) if(lastGreater1ScanPos != −1 ) coeff_abs_level_greater2_flag[lastGreater1ScanPos ] ae(v) for( n = 15; n >= 0; n−− ) { xC = ( xS << 2) + ScanOrder[ 2 ][ scanIdx ][ n ][ 0 ] yC = ( yS << 2 ) + ScanOrder[ 2][ scanIdx ][ n ][ 1 ] if( sig_coeff_flag[ xC ][ yC ] && (!sign_data_hiding_enabled_flag | | !signHidden | | (n != firstSigScanPos) ) ) coeff_sign_flag[ n ] ae(v) } numSigCoeff = 0 sumAbsLevel = 0 for(n = 15; n >= 0; n−− ) { xC = ( xS << 2 ) + ScanOrder[ 2 ][ scanIdx ][ n][ 0 ] yC = ( yS << 2 ) + ScanOrder[ 2 ][ scanIdx ][ n ][ 1 ] if(sig_coeff_flag[ xC ][ yC ] ) { baseLevel = 1 +coeff_abs_level_greater1_flag[ n ] + coeff_abs_level_greater2_flag[ n ]if( baseLevel == ( ( numSigCoeff < 8 ) ? ( (n == lastGreater1ScanPos) ?3 : 2 ) : 1 ) ) coeff_abs_level_remaining[ n ] ae(v) TransCoeffLevel[ x0][ y0 ][ cIdx ][ xC ][ yC ] = ( coeff_abs_level_remaining[ n ] +baseLevel ) * ( 1 − 2 * coeff_sign_flag[ n ] ) if(sign_data_hiding_enabled_flag && signHidden ) { sumAbsLevel += (coeff_abs_level_remaining[ n ] + baseLevel ) if( ( n == firstSigScanPos) && ( ( sumAbsLevel % 2 ) == 1 ) ) TransCoeffLevel[ x0 ][ y0 ][ cIdx ][xC ][ yC ] = −TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ] }numSigCoeff++ } } } }

As specified in section 7.4.3.3 of JCTVC-M1005_v2,sign_data_hiding_enabled_flag equal to 0 specifies that sign bit hiding(i.e., sign data hiding) is disabled. sign_data_hiding_enabled_flagequal to 1 specifies that sign bit hiding is enabled. This disclosuremay use the terms “sign bit hiding” and “sign data hiding”interchangeably. Furthermore, a video coder may organize syntax elementsrepresenting transform coefficients according to a sub-block scanningorder. In the sub-block scanning order, the video coder divides atransform coefficient block into sub-blocks, each being 4 transformcoefficients wide and 4 transform coefficients high. The video coder maydetermine a sign hidden variable (i.e., signHidden) for each of thesub-blocks. When the difference in positions between a first significant(i.e., non-zero) transform coefficient in a 4×4 sub-block of a transformcoefficient block and a last significant transform coefficient in the4×4 sub-block of the transform coefficient block is greater than 3(i.e., lastSignScanPos−firstSigScanPos>3) and the transform andquantization steps are not bypassed (i.e., skipped) for the current CU(i.e., !cu_transquant_bypass_flag), the video coder may determine thatthe sign hidden variable (i.e., signHidden) for the 4×4 sub-block isequal to 1. If the transform is skipped or bypassed, the transformcoefficients are actually prediction residuals.

For each respective transform coefficient in the 4×4 sub-block, a signsyntax element (e.g., coeff_sign_flag[n]) for the respective transformcoefficient is signaled in the bitstream if the respective transformcoefficient is significant (i.e., non-zero) and if thesign_data_hiding_enabled_flag specifies that sign bit hiding is notenabled, the sign hidden variable for the 4×4 sub-block is not equal to1, or the respective transform coefficient is not the first significanttransform coefficient in the 4×4 sub-block. For instance, the sign of asignificant transform coefficient is not signaled if thesign_data_hiding_enabled_flag indicates that sign bit hiding is enabled,the difference in position between the first significant coefficient ofthe 4×4 sub-block and the last significant coefficient of the 4×4sub-block is greater than 3, the 4×4 sub-block was not generated usingtransform and quantization bypass coding (e.g. lossless coding), and therespective transform coefficient is the first significant transformcoefficient of the 4×4 sub-block.

As specified in section 7.4.3.3 of JCTVC-M1005_v2, coeff_sign_flag[n]specifies the sign of a transform coefficient level for the scanningposition n as follows. If coeff_sign_flag[n] is equal to 0, thecorresponding transform coefficient level has a positive value.Otherwise (coeff_sign_flag[n] is equal to 1), the correspondingtransform coefficient level has a negative value. Whencoeff_sign_flag[n] is not present, coeff_sign_flag[n] is inferred to beequal to 0.

When sign data hiding is enabled, video encoder 20 may embed dataindicating the sign of a transform coefficient/residual sample in thevalue of the transform coefficient/residual sample value itself. Forinstance, video encoder 20 may modify one or more bits representing atransform coefficient/residual sample such that the parity informationcan be used by video decoder 30 to determine whether the firstsignificant coefficient in a 4×4 subblock is positive or negative. Forexample, if the sum of absolute values of transform coefficients in a4×4 subblock is even, the sign is inferred to be positive, otherwise thesign is inferred to be negative. Typically, video encoder 20 may changea least significant bit of the representation of one of the quantizedtransform coefficient/residual samples in a 4×4 subblock. Consequently,a user may not be able to perceive any loss of visual quality due tovideo encoder 20 modifying a bit of representation of the transformcoefficient/residual sample to indicate the sign of the transformcoefficient/residual sample.

When using the described techniques of this disclosure for lossy coding,it may be difficult for a video encoder to implement sign data hidingfor blocks to which the described techniques are applied. These areintra blocks for which transform is skipped and the modes are planarand/or DC and/or the modes for which residual DPCM is applied. Errorsmay be introduced by video encoder 20 changing values of bits in therepresentation of the transform coefficient/residual sample to indicatethe sign of the transform coefficient/residual sample. Furthermore,using these techniques, the error in one modified residual sample canpropagate to subsequent residual samples. Such errors may be compoundedwhen residual DPCM is applied because residual DPCM may rely on videodecoder 30 adding together multiple transform coefficients/residualsamples to determine transform coefficients/residual samples. Thus, signdata hiding may actually result in degradation of performance. In suchcases, sign data hiding may be normatively disabled. This means thateven though it is indicated in a bitstream (or as a default choice) thatsign data hiding is being used, sign data hiding is disabled for certainblocks.

In one example, a video coder may disable sign data hiding for a blockif the video coder does not apply a transform to the block, if the blockis intra predicted using a planar intra prediction mode or a DC intraprediction mode, or if the block is intra predicted using an intraprediction mode for with residual DPCM is applied. For instance, in someexamples, sign data hiding may be disabled when transform is skipped andthe block is intra-coded and the intra mode is planar intra prediction.Moreover, in some examples, sign data hiding may be disabled whentransform is skipped and the block is intra-coded and the intra mode isDC intra prediction. Furthermore, in some examples, sign data hiding maybe disabled when transform is skipped and the block is intra-coded andthe intra mode is a mode for which residual DPCM is applied.

For example, video encoder 20 may determine that sign data hiding isdisabled for a current block if the current block is generated usinglossy coding without application of a transform (e.g., a discrete cosinetransform, directional transform, or other transform) to residual dataand the current block is intra predicted using an intra prediction modein which residual DPCM is used. When sign data hiding is disabled forthe current block, video encoder 20 may include, in the bitstream, foreach respective significant value in the current block, a respectivesyntax element indicating whether the respective significant value ispositive or negative. Similarly, in this example, video decoder 30 maydetermine that sign data hiding is disabled for the current block if thecurrent block is generated using lossy coding without application of atransform (e.g., a discrete cosine transform, directional transform, orother transform) to residual data and the current block is intrapredicted using an intra prediction mode in which residual DPCM is used.In such examples, when sign data hiding is disabled for the currentblock, video decoder 30 obtains, from the bitstream, for each respectivesignificant value in the block, a respective syntax element indicatingwhether the respective significant value is positive or negative.

In other examples, sign data hiding may be disabled for a block whentransform is skipped, the block is intra-coded, or for all thetransform-skip blocks. Thus, in this example, sign data hiding may bedisabled regardless of which intra prediction mode is used. Forinstance, a video coder may determine that sign data hiding is disabledfor a current block if the current block is coded without application ofthe transform to the residual data of the current block, and the currentblock is intra coded using a DC intra prediction mode or a planar intraprediction mode.

It should be noted that this disclosure has discussed techniques forresidual DPCM and modifications to DC and planar. Any one or acombination of these techniques may be used.

FIG. 6 is a block diagram illustrating an example video encoder 20 thatmay implement the techniques of this disclosure. FIG. 6 is provided forpurposes of explanation and should not be considered limiting of thetechniques as broadly exemplified and described in this disclosure. Forpurposes of explanation, this disclosure describes video encoder 20 inthe context of HEVC coding. However, the techniques of this disclosuremay be applicable to other coding standards or methods.

In the example of FIG. 6, video encoder 20 includes a predictionprocessing unit 100, a residual generation unit 102, a transformprocessing unit 104, a quantization unit 106, an inverse quantizationunit 108, an inverse transform processing unit 110, a reconstructionunit 112, a filter unit 114, a decoded picture buffer 116, and anentropy encoding unit 118. Prediction processing unit 100 includes aninter-prediction processing unit 120 and an intra-prediction processingunit 126. Inter-prediction processing unit 120 includes a motionestimation unit 122 and a motion compensation unit 124. In otherexamples, video encoder 20 may include more, fewer, or differentfunctional components.

Video encoder 20 may receive video data. Video encoder 20 may encodeeach CTU in a slice of a picture of the video data. Each of the CTUs maybe associated with equally-sized luma coding tree blocks (CTBs) andcorresponding CTBs of the picture. As part of encoding a CTU, predictionprocessing unit 100 may perform quad-tree partitioning to divide theCTBs of the CTU into progressively-smaller blocks. The smaller block maybe coding blocks of CUs. For example, prediction processing unit 100 maypartition a CTB associated with a CTU into four equally-sizedsub-blocks, partition one or more of the sub-blocks into fourequally-sized sub-sub-blocks, and so on.

Video encoder 20 may encode CUs of a CTU to generate encodedrepresentations of the CUs (i.e., coded CUs). As part of encoding a CU,prediction processing unit 100 may partition the coding blocksassociated with the CU among one or more PUs of the CU. Thus, each PUmay be associated with a luma prediction block and corresponding chromaprediction blocks. Video encoder 20 and video decoder 30 may support PUshaving various sizes. As indicated above, the size of a CU may refer tothe size of the luma coding block of the CU and the size of a PU mayrefer to the size of a luma prediction block of the PU. Assuming thatthe size of a particular CU is 2N×2N, video encoder 20 and video decoder30 may support PU sizes of 2N×2N or N×N for intra prediction, andsymmetric PU sizes of 2N×2N, 2N×N, N×2N, N×N, or similar for interprediction. Video encoder 20 and video decoder 30 may also supportasymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2Nfor inter prediction.

Inter-prediction processing unit 120 may generate predictive data for aPU by performing inter prediction on each PU of a CU. The predictivedata for the PU may include a predictive sample blocks (i.e., predictiveblocks) of the PU and motion information for the PU. Inter-predictionunit 121 may perform different operations for a PU of a CU depending onwhether the PU is in an I slice, a P slice, or a B slice. In an I slice,all PUs are intra predicted. Hence, if the PU is in an I slice,inter-prediction unit 121 does not perform inter prediction on the PU.Thus, for blocks encoded in I-mode, the predictive block is formed usingspatial prediction from previously-encoded neighboring blocks within thesame frame.

If a PU is in a P slice, motion estimation unit 122 may search thereference pictures in a list of reference pictures (e.g., “RefPicList0”)for a reference region for the PU. The reference region for the PU maybe a region, within a reference picture, that contains samples (e.g.,sample blocks) that most closely corresponds to the sample blocks of thePU. Motion estimation unit 122 may generate a reference index thatindicates a position in RefPicList0 of the reference picture containingthe reference region for the PU. In addition, motion estimation unit 122may generate a motion vector that indicates a spatial displacementbetween a coding block of the PU and a reference location associatedwith the reference region. For instance, the motion vector may be atwo-dimensional vector that provides an offset from the coordinates inthe current decoded picture to coordinates in a reference picture.Motion estimation unit 122 may output the reference index and the motionvector as the motion information of the PU. Motion compensation unit 124may generate the predictive sample blocks of the PU based on actual orinterpolated samples at the reference location indicated by the motionvector of the PU.

If a PU is in a B slice, motion estimation unit 122 may performuni-prediction or bi-prediction for the PU. To perform uni-predictionfor the PU, motion estimation unit 122 may search the reference picturesof RefPicList0 or a second reference picture list (“RefPicList1”) for areference region for the PU. Motion estimation unit 122 may output, asthe motion information of the PU, a reference index that indicates aposition in RefPicList0 or RefPicList1 of the reference picture thatcontains the reference region, a motion vector that indicates a spatialdisplacement between a sample block of the PU and a reference locationassociated with the reference region, and one or more predictiondirection indicators that indicate whether the reference picture is inRefPicList0 or RefPicList1. Motion compensation unit 124 may generatethe predictive sample blocks of the PU based at least in part on actualor interpolated samples at the reference region indicated by the motionvector of the PU.

To perform bi-directional inter prediction for a PU, motion estimationunit 122 may search the reference pictures in RefPicList0 for areference region for the PU and may also search the reference picturesin RefPicList1 for another reference region for the PU. Motionestimation unit 122 may generate reference picture indexes (i.e.,reference indexes) that indicate positions in RefPicList0 andRefPicList1 of the reference pictures that contain the referenceregions. In addition, motion estimation unit 122 may generate motionvectors that indicate spatial displacements between the referencelocation associated with the reference regions and a sample block of thePU. The motion information of the PU may include the reference indexesand the motion vectors of the PU. Motion compensation unit 124 maygenerate the predictive sample blocks of the PU based at least in parton actual or interpolated samples at the reference region indicated bythe motion vector of the PU.

In accordance with one or more techniques of this disclosure, one ormore units within prediction processing unit 100 (such asintra-prediction processing unit 126) may perform one or more of thetechniques described herein as part of a video encoding process.

Intra-prediction processing unit 126 may generate predictive data for aPU by performing intra prediction on the PU. The predictive data for thePU may include predictive blocks for the PU and various syntax elements.Intra-prediction processing unit 126 may perform intra prediction on PUsin I slices, P slices, and B slices.

To perform intra prediction on a PU, intra-prediction processing unit126 may use multiple intra prediction modes to generate multiple sets ofpredictive data for the PU. To use some intra prediction modes togenerate a set of predictive data for the PU, intra-predictionprocessing unit 126 may extend samples from sample blocks of neighboringPUs across the sample blocks of the PU in a direction associated withthe intra prediction mode. The neighboring PUs may be above, above andto the right, above and to the left, or to the left of the PU, assuminga left-to-right, top-to-bottom encoding order for PUs, CUs, and CTUs.Intra-prediction processing unit 126 may use various numbers of intraprediction modes, e.g., 33 directional intra prediction modes. In someexamples, the number of intra prediction modes may depend on the size ofthe region associated with the PU. Moreover, as described herein,intra-prediction processing unit 126 may implement lossless coding modesand the modifications described herein to improve such coding modes. Inaccordance with some techniques of this disclosure, intra-predictionprocessing unit 126 may use one or more original sample values within ablock to perform intra DC prediction of other sample values within theblock.

Prediction processing unit 100 may select the predictive data for PUs ofa CU from among the predictive data generated by inter-predictionprocessing unit 120 for the PUs or the predictive data generated byintra-prediction processing unit 126 for the PUs. In some examples,prediction processing unit 100 selects the predictive data for the PUsof the CU based on rate/distortion metrics of the sets of predictivedata. The predictive sample blocks of the selected predictive data maybe referred to herein as the selected predictive sample blocks.

Residual generation unit 102 may generate, based on coding blocks (e.g.,the luma, Cb and Cr coding blocks) of a CU and the selected predictiveblocks (e.g., luma, Cb and Cr blocks) of the PUs of the CU, residualblocks (e.g., luma, Cb and Cr residual blocks) for the CU. For instance,residual generation unit 102 may generate the residual blocks of the CUsuch that each sample in the residual blocks has a value equal to adifference between a sample in a coding block of the CU and acorresponding sample in a corresponding selected predictive block of aPU of the CU.

Transform processing unit 104 may perform quad-tree partitioning topartition the residual blocks associated with a CU into transform blocksassociated with TUs of the CU. Thus, a TU may be associated with a lumatransform block and two chroma transform blocks. The sizes and positionsof the luma and chroma transform blocks of TUs of a CU may or may not bebased on the sizes and positions of prediction blocks of the PUs of theCU. A quad-tree structure known as a “residual quad-tree” (RQT) mayinclude nodes associated with each of the regions. The TUs of a CU maycorrespond to leaf nodes of the RQT.

Transform processing unit 104 may generate transform coefficient blocksfor each TU of a CU by applying one or more transforms to the transformblocks of the TU. Transform processing unit 104 may apply varioustransforms to a transform block associated with a TU. For example,transform processing unit 104 may apply a discrete cosine transform(DCT), a directional transform, or a conceptually similar transform to atransform block. In some examples, transform processing unit 104 doesnot apply transforms to a transform block. In such examples, thetransform block may be treated as a transform coefficient block.

Quantization unit 106 may quantize the transform coefficients in acoefficient block. The quantization process may reduce the bit depthassociated with some or all of the transform coefficients. For example,an n-bit transform coefficient may be rounded down to an m-bit transformcoefficient during quantization, where n is greater than m. Quantizationunit 106 may quantize a coefficient block associated with a TU of a CUbased on a quantization parameter (QP) value associated with the CU.Video encoder 20 may adjust the degree of quantization applied to thecoefficient blocks associated with a CU by adjusting the QP valueassociated with the CU. Quantization may introduce loss of information,thus quantized transform coefficients may have lower precision than theoriginal ones.

In accordance with some examples of this disclosure, the following maybe performed for 0≦i≦(M−1) and 0≦j≦(N−1), where M is a height of a blockand N is the width of a block. In such examples, the block is a residualblock that includes residual values indicating differences betweensample values in a predictive block generated using intra prediction andoriginal samples values. Furthermore, in such examples, the block is atransform skip block. Residual generation unit 102 may determine amodified residual {tilde over (r)}_(i,j) value for a residual valuer_(i,j). If the block is coded using a vertical intra prediction mode,{tilde over (r)}_(i,j) is defined as:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{r_{i,j} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)},}\end{matrix} \right.$

In the equation above, Q(r_((i−1),j)) denotes a reconstructed residualvalue for a residual value r_(i−1,j) one column left of the residualvalue r_(i,j). If the block is coded using a horizontal intra predictionmode, {tilde over (r)}_(i,j) is defined as:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - {Q\left( r_{i,{({j - 1})}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)},}\end{matrix} \right.$

In the equation above, Q(r_(i,(j−1)) denotes a reconstructed residualvalue for a residual value r_(i,j−1) one row above the residual valuer_(i,j). Quantization unit 106 may quantize the modified residual value{tilde over (r)}_(i,j) to produce a quantized modified residual valueQ({tilde over (r)}_(i,j)).

Inverse quantization unit 108 and inverse transform processing unit 110may apply inverse quantization and inverse transforms to a coefficientblock, respectively, to reconstruct a residual block from thecoefficient block. Reconstruction unit 112 may add the reconstructedresidual block to corresponding samples from one or more predictiveblocks generated by prediction processing unit 100 to produce areconstructed transform block associated with a TU. By reconstructingtransform blocks for each TU of a CU in this way, video encoder 20 mayreconstruct the coding blocks of the CU.

Filter unit 114 may perform one or more deblocking operations to reduceblocking artifacts in the coding blocks associated with a CU. Decodedpicture buffer 116 may store the reconstructed coding blocks afterfilter unit 114 performs the one or more deblocking operations on thereconstructed coding blocks. Inter-prediction processing unit 120 mayuse a reference picture that contains the reconstructed coding blocks toperform inter prediction on PUs of other pictures. In addition,intra-prediction processing unit 126 may use reconstructed coding blocksin decoded picture buffer 116 to perform intra prediction on other PUsin the same picture as the CU.

Entropy encoding unit 118 may receive data from other functionalcomponents of video encoder 20. For example, entropy encoding unit 118may receive coefficient blocks from quantization unit 106 and mayreceive syntax elements from prediction processing unit 100. Entropyencoding unit 118 may perform one or more entropy encoding operations onthe data to generate entropy-encoded data. For example, entropy encodingunit 118 may perform a context-adaptive variable length coding (CAVLC)operation, a CABAC operation, a variable-to-variable (V2V) length codingoperation, a syntax-based context-adaptive binary arithmetic coding(SBAC) operation, a Probability Interval Partitioning Entropy (PIPE)coding operation, an Exponential-Golomb encoding operation, or anothertype of entropy encoding operation on the data. Video encoder 20 mayoutput a bitstream that includes entropy-encoded data generated byentropy encoding unit 118. For instance, the bitstream may include datathat represents a RQT for a CU.

In accordance with some examples of this disclosure, entropy encodingunit 118 may determine that sign data hiding is disabled for a currentblock if the current block is generated without application of atransform to residual data and the current block is intra predictedusing an intra prediction mode in which residual DPCM is used. When signdata hiding is disabled for the current block, entropy encoding unit 118may include, in the bitstream, a syntax element indicating whether avalue in the current block is positive or negative.

Element 130 in FIG. 6 may represent a switch (or a conceptual switch)for selecting between lossless coding and lossy coding. Control signal132 may represent a signal from prediction processing unit 100 thatdetermines the lossless or lossy coding and element 134 may represent adecoding loop that bypasses the inverse transform and inversequantization processes. In some examples, lossless coding eliminatestransforms and quantization. In other examples, lossless coding performstransforms and eliminates only the quantization process. In still otherexamples, lossless coding may be implemented with the use of transformsand quantitation, but the quantization parameter may be selected so asto avoid any quantization data loss. These and other examples are withinthe scope of this disclosure.

Elements 136 and 138 represent switches (or conceptual switches) thatmay be used to implement a transform skipping mode. In transformskipping modes, the residual data is not transformed by transformprocessing unit 104 but is quantized by quantization unit 106. Thus, thedash lines of element 136 represent two possible data paths. In onedata, the residual data is quantized by quantization unit 106 and in theother data path the residual data is not quantized by quantization unit106. Similarly, in the decoding loop of video encoder 20, the residualdata is inverse quantized by inverse quantization unit 108 but is nottransformed by inverse transform processing unit 110. Thus, the dashlines of element 138 represent an alternate data path where the residualdata is inverse quantized by inverse quantization unit 108 but is nottransformed by inverse transform processing unit 110.

FIG. 7 is a block diagram illustrating an example video decoder 30 thatis configured to implement the techniques of this disclosure. FIG. 7 isprovided for purposes of explanation and is not limiting on thetechniques as broadly exemplified and described in this disclosure. Forpurposes of explanation, this disclosure describes video decoder 30 inthe context of HEVC coding. However, the techniques of this disclosuremay be applicable to other coding standards or methods.

In the example of FIG. 7, video decoder 30 includes an entropy decodingunit 150, a prediction processing unit 152, an inverse quantization unit154, an inverse transform processing unit 156, a reconstruction unit158, a filter unit 160, and a decoded picture buffer 162. Predictionprocessing unit 152 includes a motion compensation unit 164 and anintra-prediction processing unit 166. In other examples, video decoder30 may include more, fewer, or different functional components.

Video decoder 30 may receive a bitstream. Entropy decoding unit 150 mayparse the bitstream to decode syntax elements from the bitstream.Entropy decoding unit 150 may entropy decode entropy-encoded syntaxelements in the bitstream. Prediction processing unit 152, inversequantization unit 154, inverse transform processing unit 156,reconstruction unit 158, and filter unit 160 may generate decoded videodata based on the syntax elements extracted from the bitstream.

The bitstream may comprise a series of NAL units. The NAL units of thebitstream may include coded slice NAL units. As part of decoding thebitstream, entropy decoding unit 150 may extract and entropy decodesyntax elements from the coded slice NAL units. Each of the coded slicesmay include a slice header and slice data. The slice header may containsyntax elements pertaining to a slice. The syntax elements in the sliceheader may include a syntax element that identifies a PPS associatedwith a picture that contains the slice.

In accordance with some examples of this disclosure, entropy decodingunit 150 determines that sign data hiding is disabled for a currentblock if the current block is generated without application of atransform to residual data and the current block is intra predictedusing an intra prediction mode in which residual DPCM is used. In suchexamples, when sign data hiding is disabled for the current block,entropy decoding unit 150 obtains, from the bitstream, for eachrespective significant value in the block, a respective syntax elementindicating whether the respective significant value is positive ornegative.

In addition to decoding (i.e., obtaining) syntax elements from thebitstream, video decoder 30 may perform a reconstruction operation on anon-partitioned CU. To perform the reconstruction operation on anon-partitioned CU, video decoder 30 may perform a reconstructionoperation on each TU of the CU. By performing the reconstructionoperation for each TU of the CU, video decoder 30 may reconstructresidual blocks of the CU.

As part of performing a reconstruction operation on a TU of a CU,inverse quantization unit 154 may inverse quantize, i.e., de-quantize,coefficient blocks associated with the TU. Inverse quantization unit 154may use a QP value associated with the CU of the TU to determine adegree of quantization and, likewise, a degree of inverse quantizationfor inverse quantization unit 154 to apply. That is, the compressionratio, i.e., the ratio of the number of bits used to represent theoriginal sequence and the compressed one, may be controlled by adjustingthe value of the QP used when quantizing transform coefficients. Thecompression ratio may also depend on the method of entropy codingemployed.

After inverse quantization unit 154 inverse quantizes a coefficientblock, inverse transform processing unit 156 may apply one or moreinverse transforms to the coefficient block in order to generate aresidual block associated with the TU. For example, inverse transformprocessing unit 156 may apply an inverse DCT, an inverse integertransform, an inverse Karhunen-Loeve transform (KLT), an inverserotational transform, an inverse directional transform, or anotherinverse transform to the coefficient block.

If a PU is encoded using intra prediction, intra-prediction processingunit 166 may perform intra prediction to generate predictive blocks forthe PU. Intra-prediction processing unit 166 may use an intra predictionmode to generate the predictive blocks (e.g., predictive luma, Cb and Crblocks) for the PU based on the prediction blocks ofspatially-neighboring PUs. Intra-prediction processing unit 166 maydetermine the intra prediction mode for the PU based on one or moresyntax elements decoded from the bitstream. In accordance with sometechniques of this disclosure, intra-prediction processing unit 166 mayuse one or more original sample values within a block to perform intraDC prediction of other sample values within the block. That is,intra-prediction processing unit 166 may generate a predictive block. Aspart of generating the predictive block, intra-prediction processingunit 166 may use at least one of a losslessly reconstructed sample toleft of a current sample in a current row of a predictive block and alosslessly reconstructed sample for a row of the predictive block abovethe current row for DC prediction of the current sample

Prediction processing unit 152 may construct a first reference picturelist (RefPicList0) and a second reference picture list (RefPicList1)based on syntax elements extracted from the bitstream. Furthermore, if aPU is encoded using inter prediction, entropy decoding unit 150 mayextract motion information for the PU. Motion compensation unit 164 maydetermine, based on the motion information of the PU, one or morereference regions for the PU. Motion compensation unit 164 may generate,based on samples blocks at the one or more reference blocks for the PU,predictive blocks (e.g., luma, Cb and Cr blocks) for the PU. Inaccordance with one or more techniques of this disclosure, one or moreunits within prediction processing unit 152 (such as intra predictionprocessing unit 166) may perform techniques described herein as part ofa video decoding process.

Reconstruction unit 158 may use the transform block (e.g., luma, Cb andCr transform blocks) associated with TUs of a CU and the predictiveblocks (e.g., luma, Cb and Cr predictive blocks) of the PUs of the CU,i.e., either intra-prediction data or inter-prediction data, asapplicable, to reconstruct the coding blocks (e.g., luma, Cb and Crcoding blocks) of the CU. For example, reconstruction unit 158 may addsamples of the luma, Cb and Cr transform blocks to corresponding samplesof the predictive luma, Cb and Cr blocks to reconstruct the luma, Cb andCr coding blocks of the CU.

In accordance with some examples of this disclosure, entropy decodingunit 150 may generate a block of residual values. This block may be atransform skip block. Furthermore, the block may be a residual blockthat includes residual values indicating differences between originalsample values and sample values in a predictive block generated usingintra prediction. Furthermore, for 0≦i≦(M−1) and 0≦j≦(N−1), where M is aheight of the block and N is the width of the block, inversequantization unit 154 may calculate a reconstructed residual valueQ(r_(i,j)) for a residual value r_(i,j) in the block. If the block iscoded using a vertical intra prediction mode (or, in some examples, anear-vertical intra prediction mode), Q(r_(i,j)) is defined as:

${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{{i - 1},j} \right)}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.$

In the equation above, Q({tilde over (r)}_(i,j)) denotes a quantizedversion of a modified residual value {tilde over (r)}_(i,j), themodified residual value {tilde over (r)}_(i,j) is a modified version ofthe residual value r_(i,j), and Q(r_(i−1,j)) is a reconstructed residualvalue for (i.e., corresponding to) a residual value one column left ofthe residual value r_(i,j). Entropy decoding unit 150 may havepreviously determined Q(r_(i−1,j)) in the same manner that entropydecoding unit 150 determines Q(r_(i,j)). If the block is coded using ahorizontal intra prediction mode, Q(r_(i,j)) is defined as:

${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{i,{j - 1}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.$

In the equation above, Q(r_(i,j−1)) is a reconstructed residual valuefor a residual value one row above the residual value r_(i,j). Entropydecoding unit 150 may have previously determined Q(r_(i,j−1)) in thesame manner that entropy decoding unit 150 determines Q(r_(i,j)).Reconstruction unit 158 may add the reconstructed residual valueQ(r_(i,j)) to a prediction value to reconstruct a sample value.

Filter unit 160 may perform a deblocking operation to reduce blockingartifacts associated with the coding blocks (e.g., the luma, Cb and Crcoding blocks) of the CU. Video decoder 30 may store the coding blocks(e.g., luma, Cb and Cr coding blocks) of the CU in decoded picturebuffer 162. Decoded picture buffer 162 may provide reference picturesfor subsequent motion compensation, intra prediction, and presentationon a display device, such as display device 32 of FIG. 1. For instance,video decoder 30 may perform, based on the blocks (e.g., luma, Cb and Crblocks) in decoded picture buffer 162, intra prediction or interprediction operations on PUs of other CUs. In this way, video decoder 30may extract, from the bitstream, transform coefficient levels of thesignificant luma coefficient block, inverse quantize the transformcoefficient levels, apply a transform to the transform coefficientlevels to generate a transform block, generate, based at least in parton the transform block, a coding block, and output the coding block fordisplay.

Element 170 may represent a normal coding path for lossy compression,and element 172 may represent a bypass coding path that bypasses theinverse transform and inverse quantization processes. These differentpaths are merely exemplary and lossless coding may be performed withoutany bypass. In some examples, lossless coding eliminates transforms andquantization. In other examples, lossless coding performs transforms andeliminates only the quantization process. In still other examples,lossless coding may be implemented with the use of transforms andquantitation, but the quantization parameter may be selected so as toavoid any quantization data loss. Element 174 represents an example of apath that may be used for a transform skipping mode. In a transformskipping mode, the residual data may be inverse quantized by inversequantization unit 154, but the inverse transforming of inverse transformprocessing unit 156 may be skipped. These and other examples are withinthe scope of this disclosure.

FIG. 8A is a flowchart illustrating an example operation of videoencoder 20, in accordance with one or more techniques of thisdisclosure. In other examples of this disclosure, operations similar tothe operation of FIG. 8A may include more, fewer, or different actions.Furthermore, in some examples, one or more actions of the operation ofFIG. 8A may be omitted or rearranged. For instance, in FIG. 8A and FIG.8B, dashed lines indicate actions not performed in some examples.

In the example of FIG. 8A, video encoder 20 may generate a predictiveblock (200). As part of generating the predictive block, video encoder20 may use at least one of: a losslessly reconstructed sample to left ofa current sample in a current row of a predictive block and a losslesslyreconstructed sample for a row of the predictive block above the currentrow for DC prediction of the current sample (202). In some examples,video decoder 30 processes samples in the predictive block in ahorizontal raster scan order, a vertical raster scan order, a diagonalscan order, or a zig-zag scan order. In such examples, processing thesamples in the predictive block may comprise determining DC predictionsfor the samples as well as reconstructing the samples losslessly.Furthermore, in the example of FIG. 8A, video encoder 20 may generateresidual samples that have values equal to a difference between a samplein a coding block and a corresponding sample in the predictive block

FIG. 8B is a flowchart illustrating an example operation of videodecoder 30, in accordance with one or more techniques of thisdisclosure. In other examples of this disclosure, operations similar tothe operation of FIG. 8B may include more, fewer, or different actions.Furthermore, in some examples, one or more actions of the operation ofFIG. 8B may be omitted or rearranged.

In the example of FIG. 8B, video decoder 30 may generate a predictiveblock (250). As part of generating the predictive block, video decoder30 may use at least one of a losslessly reconstructed sample to left ofa current sample in a current row of a predictive block and a losslesslyreconstructed sample for a row of the predictive block above the currentrow for DC prediction of the current sample (252). In some examples,video decoder 30 processes samples in the predictive block in ahorizontal raster scan order, a vertical raster scan order, a diagonalscan order, or a zig-zag scan order. In such examples, processing thesamples in the predictive block may comprise determining DC predictionsfor the samples. Furthermore, in the example of FIG. 8B, video decoder30 may reconstruct a coding block by adding samples of the predictiveblock to corresponding residual samples (254).

FIG. 9A is a flowchart illustrating an example operation of videoencoder 20, in accordance with one or more techniques of thisdisclosure. In other examples of this disclosure, operations similar tothe operation of FIG. 9A may include more, fewer, or different actions.Furthermore, in some examples, one or more actions of the operation ofFIG. 9A may be omitted or rearranged. The example of FIG. 9A isexplained with reference to components shown in FIG. 6. However, theoperation of FIG. 9A may be performed by components and types of videoencoders other than that shown in FIG. 6.

As indicated in the example of FIG. 9A, residual generation unit 102 ofvideo encoder 20 may generate a block of residual values (350). In thisexample, the block of residual values is a transform skip block. Theblock may be a residual block that includes residual values indicatingdifferences between original sample values and sample values in apredictive block generated using intra prediction. The video coder mayperform the remaining actions of FIG. 9A for each location (i,j) of theblock, where 0≦i≦(M−1) and 0≦j≦(N−1), M is a height of a block, and N isthe width of the block.

Furthermore, residual generation unit 102 of video encoder 20 maydetermine a modified residual value {tilde over (r)}_(i,j) for aresidual value r_(i,j) in the block (352). If the block is coded using avertical intra prediction mode, or in some examples, an intra predictionmode between 22 and 30 as defined in HEVC Working Draft 10, {tilde over(r)}_(i,j) is defined as:

${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{r_{i,j} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$

Q(r_(i−1),j)) denotes a reconstructed residual value for (i.e.,corresponding to) a residual value r_(i−1,j). If the block is codedusing a horizontal intra prediction mode, or, in some examples, an intraprediction mode between 6 and 14, {tilde over (r)}_(i,j) is defined as:

${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{r_{i,j} - {Q\left( r_{i,{({j - 1})}} \right)}},} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$

Q(r_(i,(j−1)) denotes a reconstructed residual value for a residualvalue r_(i,j−1).

In addition, quantization unit 106 of video encoder 20 may quantize themodified residual value {tilde over (r)}_(i,j) to produce a quantizedmodified residual value Q({tilde over (r)}_(i,j)) (354). Video encoder20 may signal the quantized modified residual value Q({tilde over(r)}_(i,j)) in a bitstream (356). For example, video encoder 20 maygenerate one or more syntax elements indicating the quantized modifiedresidual value Q({tilde over (r)}_(i,j)). In this example, entropyencoding unit 118 of video encoder 20 may entropy encode the one or moresyntax elements and include the resulting data in the bitstream.

Furthermore, in the example of FIG. 9A, video encoder 20 may calculate areconstructed residual value Q(r_(i,j)) (358). In some examples, videoencoder 20 may calculate the reconstructed residual value Q(r_(i,j)) aspart of a feedback loop to determine reconstructed sample values for usein further intra prediction or inter prediction. If the block is codedusing the vertical intra prediction mode (or in some examples, a nearvertical intra prediction mode), the reconstructed residual valueQ(r_(i,j)) may be defined as:

${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{{i - 1},j} \right)}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$

If the block is coded using the horizontal intra prediction mode (or insome examples, a near horizontal intra prediction mode), Q(r_(i,j)) maybe defined as:

${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{i,{j - 1}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.$

Because the block is a transform skip block, inverse transformprocessing unit 110 does not apply an inverse transform to the residualvalue r_(i,j). Hence, reconstruction unit 112 of video encoder 20 mayadd the reconstructed residual value Q(r_(i,j)) to a prediction value todetermine a reconstructed sample value (360). The prediction value maybe a sample in a predictive block. Prediction processing unit 100 ofvideo encoder 20 may use the reconstructed sample value for intraprediction or inter prediction of other blocks (362).

FIG. 9B is a flowchart illustrating an example operation of videodecoder 30, in accordance with one or more techniques of thisdisclosure. In other examples of this disclosure, operations similar tothe operation of FIG. 9B may include more, fewer, or different actions.Furthermore, in some examples, one or more actions of the operation ofFIG. 9B may be omitted or rearranged. The example of FIG. 9B isexplained with reference to components shown in FIG. 7. However, theoperation of FIG. 9B may be performed by components and types of videodecoders other than that shown in FIG. 7.

Video decoder 30 may perform the operation of FIG. 9B for each location(i,j) of a transform skip block, where 0≦i≦(M−1) and 0≦j≦(N−1), M is aheight of a block, and N is the width of the block. The block may be aresidual block that includes residual values indicating differencesbetween original sample values and sample values in a predictive blockgenerated using intra prediction. As indicated in the example of FIG.9A, entropy decoding unit 150 of video decoder 30 may obtain, from abitstream, one or more syntax elements indicating a modified quantizedresidual value Q({tilde over (r)}_(i,j)) (400). Entropy decoding unit150 may entropy decode some or all of the one or more syntax elements.

Furthermore, in the example of FIG. 9B, inverse quantization unit 154 ofvideo decoder 30 may calculate a reconstructed residual value Q(r_(i,j))for a residual value r_(i,j) (402). In some examples, the residual valuer_(i,j) is a bit-shifted residual value as described elsewhere in thisdisclosure. If the block is coded using a vertical intra predictionmode, Q(r_(i,j)) is defined as:

${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{{i - 1},j} \right)}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.$

Q({tilde over (r)}_(i,j)) denotes a quantized version of a modifiedresidual value {tilde over (r)}_(i,j), the modified residual value{tilde over (r)}_(i,j) is a modified version of the residual valuer_(i,j), and Q(r_(i−1,j)) is a reconstructed residual value for aresidual value one column left of the residual value r_(i,j). If theblock is coded using a horizontal intra prediction mode, Q(r_(i,j)) isdefined as:

${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{i,{j - 1}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.$

Q(r_(i,j−1)) is a reconstructed residual value for a residual value onerow above the residual value r_(i,j).

If the block is coded using the vertical intra prediction mode, themodified residual value {tilde over (r)}_(i,j) is defined as:

${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{r_{i,j} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.$

If the block is coded using the horizontal intra prediction mode, themodified residual value {tilde over (r)}_(i,j) is defined as:

${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{r_{i,j} - {Q\left( r_{i,{({j - 1})}} \right)}},} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.$

Because the block is a transform skip block, inverse transformprocessing unit 156 does not apply an inverse transform to thereconstructed residual value Q(r_(i,j)). Reconstruction unit 158 ofvideo decoder 30 may add the reconstructed residual value Q(r_(i,j)) toa prediction value to reconstruct a sample value (406). The predictionvalue may be a sample in a predictive block.

FIG. 10A is a flowchart illustrating an example video encoder operationfor sign data hiding, in accordance with one or more techniques of thisdisclosure. In other examples of this disclosure, operations similar tothe operation of FIG. 10A may include more, fewer, or different actions.Furthermore, in some examples, one or more actions of the operation ofFIG. 10A may be omitted or rearranged.

In the example of FIG. 10A, video encoder 20 generates a bitstream thatincludes a sequence of bits that forms a coded representation of videodata (600). As part of generating the bitstream, video encoder 20 maydetermine that sign data hiding is disabled for a current block if thecurrent block is generated without application of a transform toresidual data and the current block is intra predicted using an intraprediction mode in which a residual DPCM technique is used (602). In thecontext of FIG. 10A, the current block may be a 4×4 sub-block of a blockof residual samples to which the residual DPCM technique has beenapplied. Subsequently, in the example of FIG. 10A, video encoder 20 mayoutput the bitstream (604).

In some examples, when sign data hiding is disabled for the currentblock, video encoder 20 may signal, in the bitstream, for eachrespective significant residual value in the current block, a syntaxelement indicating whether the respective significant residual value ispositive or negative. In such examples, when sign data hiding is notdisabled for the current block, video encoder 20 may not signal, in thebitstream, a syntax element indicating whether a value of at least onesignificant residual value or transform coefficient in the current blockis positive or negative.

FIG. 10B is a flowchart illustrating an example video decoder operationfor sign data hiding, in accordance with one or more techniques of thisdisclosure. In other examples of this disclosure, operations similar tothe operation of FIG. 10B may include more, fewer, or different actions.Furthermore, in some examples, one or more actions of the operation ofFIG. 10B may be omitted or rearranged.

In the example of FIG. 10B, video decoder 30 obtains syntax elementsfrom a bitstream that includes a sequence of bits that forms a codedrepresentation of video data (650). As part of obtaining the syntaxelements from the bitstream, video decoder 30 may determine that signdata hiding is disabled for a current block if the current block isgenerated without application of a transform to residual data and thecurrent block is intra predicted using an intra prediction mode in whicha residual DPCM technique is used (652). In the context of FIG. 10B, thecurrent block may be a 4×4 sub-block of a block of residual samples towhich the residual DPCM technique has been applied. Subsequently, in theexample of FIG. 10B, video decoder 30 may reconstruct a picture of thevideo data based at least in part on the syntax elements obtained fromthe bitstream (654).

In some examples, when sign data hiding is disabled for the currentblock, video decoder 30 may obtain, from the bitstream, for eachrespective significant residual value in the current block, a syntaxelement indicating whether the respective significant residual value ispositive or negative. In such examples, when sign data hiding is notdisabled for the current block, video decoder 30 may not obtain from thebitstream a syntax element indicating whether a value of a significantresidual value in the current block is positive or negative.

The following paragraphs provide a first series of examples inaccordance with one or more techniques of this disclosure.

Example 1

A method of coding video data, the method comprising: using one or moreoriginal sample values within a block of video data to perform intra DCprediction of other sample values within the block.

Example 2

The method of example 1, wherein using one or more original samplevalues within the block to perform prediction of other sample valueswithin the block comprises: using original sample values that occurearlier in a scan order to predict sample values that occur later in thescan order.

Example 3

The method of example 1, wherein using one or more original samplevalues within the block to perform prediction of other sample valueswithin the block comprises: using original sample values of a previouslyscanned row to predict sample values of a subsequently scanned row.

Example 4

The method of example 1, wherein using one or more original samplevalues within the block to perform prediction of other sample valueswithin the block comprises: using original sample values that correspondto causal neighbors of a sample to predict sample values for the sample.

Example 5

The method of any of examples 1-4, wherein a DC prediction valueDC_(i,j), for a current sample P_(i,j), 0≦i≦(M−1), 0≦j≦(N−1) iscalculated as DC_(i,j)=(P_(i,j−1)+P_(i−1,j)++1)>>1.

Example 6

The method of any of examples 1-4, wherein a DC prediction valueDC_(i,j), for a current sample P_(i,j), 0≦i≦(M−1), 0≦j≦(N−1) iscalculated as DC_(i,j)=(P_(i,j−1)+P_(i−1,j))>>1.

Example 7

The method of any of examples 1-6, further comprising: performing DCprediction in a pipelined manner.

Example 8

The method of example 7, wherein a one cycle delay for DC predictionexists between rows of the block.

Example 9

The method of any of examples 1-4, wherein a DC prediction valueDC_(i,j), 0≦i≦(M−1), 0≦j≦(N−1) is calculated asDC_(i,j)=(P_(i,j−1)+P_(i−1,j)−P_(i−1,j−1)).

Example 10

The method of example 9, wherein DC_(i,j+1) can be calculated withoutwaiting for P_(i,j) asDC_(i,j+1)=((P_(i,j−1)+P_(i−1,j)−P_(i−1,j−1))+r_(i,j)+P_(i−1,j+1)−P_(i−1,j)),where r_(i,j) is the prediction error residual for sample P_(i,j)

Example 11

The method of any of examples 1-4, wherein available ones of a leftsample, a top-left sample, and a top right sample are used for the DCprediction.

Example 12

The method of example 11, wherein a DC prediction value DC_(i,j),0≦i≦(M−1), 0≦j≦(N−1) is calculated as one of:DC_(i,j)=(P_(i,j−1)+P_(i−1,j)+P_(i−1,j−1)+P_(i−1,j+1)+2)>>2, orDC_(i,j)=(P_(i,j−1)+P_(i−1,j)+P_(i−1,j−1)+P_(i−1,j+1))>>2.

Example 13

The method of example 12, wherein for samples in a last column (j=(N−1),i>0), a top-right sample is not available and top and top-right samples(P_(i−1,j) and P_(i−1,j+1)) have the same value.

Example 14

The method of example 13, wherein the top-right sample is not used forthe DC prediction.

Example 15

A method of coding video data, the method comprising: performing DCprediction on a block size that is smaller than a transform unit (TU)size.

Example 16

The method of example 15, wherein irrespective of the TU size, the DCprediction is performed on a 2×2 block size, wherein at least some TUsizes are larger than the 2×2 block size.

Example 17

The method of example 15 or 16, wherein for samples P_(2i,2j),P_(2i,2j+1), P_(2i+1,2j), and P_(2i+1,2j+1), DC prediction values arecalculated as one of:(P_(2i−1,2j)+P_(2i−1,2j+1)+P_(2i,2j−1)P_(2i+1,2j−1)+2)>>2 or(P_(2i−1,2j)+P_(2i−1,2j+1)+P_(2i,2j−1)+P_(2i+1,2j'1))>>2, wherein,0≦i≦((M/2)−1), 0≦j≦((N/2)−1).

Example 18

The method of example 17, wherein M and N are both even.

Example 19

The method of example 18, wherein four samples can be processed inparallel.

Example 20

A method of coding video data, the method comprising: performing DCprediction on a 2×2 block size regardless of a size of a transform unit(TU).

Example 21

A method of coding video data, the method comprising: exploiting acorrelation between residuals after performing a normal DC prediction.

Example 22

The method of example 21, wherein r_(i j), 0≦i≦(M−1), 0≦j≦(N−1)represents prediction residuals after performing DC prediction asspecified according to an HEVC standard, the method further comprising:generating intermediate values s_(i,j), 0≦i≦(M−1), 0≦j≦(N−1) accordingto: s_(i,j)=r_(i,2j), s_(i,(j+(N/2)))=r_(i,2j)−r_(i,2j+1), 0≦i≦(M−1),0≦j≦((N/2)−1).

Example 23

The method of example 22, the method further comprising: generatingmodified residuals, t_(i,j), 0≦i≦(M−1), 0≦j≦(N−1) according to:t_(i,j)=s_(2i,j), t_((i+(M/2)),j)=s_(2i,j)−s_(2i+1,j), 0≦i≦((M/2)−1),0≦j≦(N−1).

Example 24

The method of example 23, wherein the modified residuals, t_(i,j), areentropy-coded.

Example 25

The method of example 21, wherein the method is performed duringdecoding and wherein: s_(2i,j)=t_(i,j),s_(2i+1,j)=t_(i,j)−t_((i+(M/2)),j), 0≦i≦((M/2)−1), 0≦j≦(N−1) andr_(i,2j)=s_(i,j), r_(i,2j+1)=s_(i,j)−s_(i,(j+(N/2))), 0≦i≦(M−1),0≦j≦((N/2)−1).

Example 26

The method of example 25, wherein the M and N are both even.

Example 27

The method of example 21, wherein:

s _(i,j) =r _(i,2j+1) ,s _(i,(j+(N/)2))=P _(i,2j)−((P _(i,2j−1) +P_(i,2j+1)+1)>>1),0≦i≦M,0≦j≦(N/2),

t _(i,j) =s _(2i+1,j) ,t _((i+(M/2)),j) =s _(2i,j)−((s _(2i+1,j) +s_(2i+1,j)+1)>>1),0≦i≦M/2,0≦j≦N.

Example 28

The method any combination of examples 1-27.

Example 29

The method of any of examples 1-24 and 27 or combinations thereof,wherein the method is performed by an encoder and wherein coding refersto encoding.

Example 30

The method of any of examples 1-21 and 25-27 or combinations thereof,wherein the method is performed by a decoder and wherein coding refersto decoding.

Example 31

A system configured to perform the method of any of examples 1-27 orcombinations thereof.

Example 32

A non-transitory computer readable storage medium storing instructionsthat when executed cause one or more processors to perform the method ofany of examples 1-27 or combinations thereof.

Example 33

A video encoding device configured to perform the method of any ofexamples 1-24 and 27 or combinations thereof.

Example 34

A video decoding device configured to perform the method of any ofexamples 1-21 and 25-27 or combinations thereof.

Example 35

A video encoding device comprising means for performing the steps of themethod of any of examples 1-24 and 27 or combinations thereof

Example 36

A video decoding device comprising means for performing the steps of themethod of any of examples 1-21 and 25-27 or combinations thereof.

The following paragraphs provide a second series of examples inaccordance with one or more techniques of this disclosure.

Example 1

A method of coding video data, the method comprising: using one or moreoriginal sample values within a block of video data to performprediction of other sample values within the block.

Example 2

The method of example 1, wherein using one or more original samplevalues within the block to perform prediction of other sample valueswithin the block comprises: using original sample values correspondingto a last row and a last column of the block to perform prediction ofthe other sample values.

Example 3

The method of example 1, wherein using one or more original samplevalues within the block to perform prediction of other sample valueswithin the block comprises: using original sample values correspondingto a first row and a first column of the block to perform prediction ofthe other sample values.

Example 4

The method of any of examples 1-3, wherein FIG. 4 illustrates thesamples locations of the sample values used for to perform prediction ofother sample values.

Example 5

The method of any of examples 1-4, wherein the method is performed for alossless coding mode.

Example 6

The method of any of examples 1-5, wherein the method is performed for aplanar coding mode.

Example 7

The method of any of examples 1-5, wherein the method is performed foran angular intra coding mode.

Example 8

The method of any of examples 1-7, the method further comprising:performing a rotate operation on set of residual values generated by theprediction; and performing entropy coding with respect to the rotatedset of residual values.

Example 9

The method of example 8, wherein the set of residual values aretransformed values.

Example 10

The method of any of examples 1-9, further comprising performing aprediction process to code the original sample values.

Example 11

The method of any combination of examples 1-10.

Example 12

The method of any of examples 1-10 or combinations thereof, wherein themethod is performed by an encoder and wherein coding refers to encoding.

Example 13

The method of any of examples 1-10 or combinations thereof, wherein themethod is performed by a decoder and wherein coding refers to decoding.

Example 14

A system configured to perform the method of any of examples 1-10 orcombinations thereof.

Example 15

A non-transitory computer readable storage medium storing instructionsthat when executed cause one or more processors to perform the method ofany of examples 1-10 or combinations thereof.

Example 16

A video encoding device configured to perform the method of any ofexamples 1-10 or combinations thereof.

Example 17

A video decoding device configured to perform the method of any ofexamples 1-10 or combinations thereof.

Example 18

A video encoding device comprising means for performing the steps of themethod of any of examples 1-10 or combinations thereof.

Example 19

A video decoding device comprising means for performing the steps of themethod of any of examples 1-10 or combinations thereof.

Example 20

Any device or method described in this disclosure.

The following paragraphs provide a third series of examples inaccordance with one or more techniques of this disclosure.

Example 1

A method of coding video data, the method comprising: determining amodified array of residual samples; determining for a modified residualsample a dequantized version of the residual sample; and adding thedequantized version of the residual sample to a prediction value todetermine a reconstructed value.

Example 2

The method of example 1, further comprising: coding the dequantizedresidual values using DPCM.

Example 3

The method of example 1, further comprising: coding a bit-shiftedversion of the dequantized residual values using DPCM.

Example 4

The method of any of examples 1-3, wherein the method is performed for anear vertical intra-prediction mode.

Example 5

The method of any of examples 1-3, wherein the method is performed for anear horizontal intra-prediction mode.

Example 6

The method of any of examples 1-5, further comprising: disabling signdata hiding.

Example 7

The method of any of examples 1-5, further comprising: disabling signdata hiding based on block type.

Example 8

The method of any of examples 1-5, further comprising: selectivelydisabling sign data hiding.

Example 9

The method of any of examples 1-8, further comprising any techniquedescribed in this disclosure.

Example 10

A method of coding video data, the method comprising: determining amodified array of residual samples; determining for a modified residualsample a quantized version of the residual sample; and signaling in anencoded bitstream the quantized version of the residual sample.

Example 11

The method of example 10, wherein the method is performed for a nearvertical intra-prediction mode.

Example 12

The method of example 10, wherein the method is performed for a nearhorizontal intra-prediction mode.

Example 13

The method of any of examples 10-12, further comprising any techniquedescribed in this disclosure.

Example 14

The method of any of examples 10-13 or combinations thereof, wherein themethod is performed by an encoder and wherein coding refers to encoding.

Example 15

The method of any of examples 1-9 or combinations thereof, wherein themethod is performed by a decoder and wherein coding refers to decoding.

Example 16

A system configured to perform the method of any of examples 1-15 orcombinations thereof.

Example 17

A non-transitory computer readable storage medium storing instructionsthat when executed cause one or more processors to perform the method ofany of examples 1-13 or combinations thereof.

Example 18

A video encoding device configured to perform the method of any ofexamples 10-13 or combinations thereof.

Example 19

A video decoding device configured to perform the method of any ofexamples 1-9 or combinations thereof.

Example 20

A video encoding device comprising means for performing the steps of themethod of any of examples 10-13 or combinations thereof.

Example 21

A video decoding device comprising means for performing the steps of themethod of any of examples 1-9 or combinations thereof.

Example 22

Any device or method described in this disclosure including in thisdisclosure.

The following paragraphs provide a fourth series of examples inaccordance with one or more techniques of this disclosure.

Example 1

A method for decoding video data, the method comprising: receiving ablock of video data encoded using lossless coding and intra prediction;reconstructing residual samples from the losslessly coded block of videodata according to a residual differential pulse code modulation (DPCM)process; and performing intra prediction according to an intraprediction mode using the residual samples to produce reconstructedvideo samples, wherein the intra prediction mode is not one of avertical intra prediction mode and a horizontal intra prediction mode.

Example 2

The method of example 1, wherein the intra prediction mode is one of anearly-vertical intra prediction mode and a nearly-horizontal intraprediction mode.

Example 3

The method of example 2, wherein the nearly-vertical intra predictionmode is one of intra prediction modes 22 to 30, and wherein thenearly-horizontal intra prediction mode is one of intra prediction modes6 to 14 as the intra modes are described in HEVC Working Draft 9.

Example 4

The method of example 2, wherein the residual DPCM process is a verticalresidual DPCM process for nearly-vertical intra prediction modes, andwherein the residual DPCM process is a horizontal residual DPCM processfor nearly-horizontal intra prediction modes.

Example 5

The method of example 1, wherein the intra prediction mode is a diagonaldown-right intra prediction mode, and wherein reconstructing residualsamples according to the residual DPCM process comprises reconstructingresidual samples according to the equation

$r_{i,j} = \left\{ \begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i - 1},{j - 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a reconstructed residual sample, {tilde over (r)} is a sampleof the losslessly coded block of video data, M and N define a size ofthe block of video data, and i and j define a location of a samplewithin the block of video data.

Example 6

The method of example 1, wherein the intra prediction mode is a diagonaldown-left intra prediction mode, and wherein reconstructing residualsamples according to the residual DPCM process comprises reconstructingresidual samples according to the equation:

$r_{i,j} = \left\{ \begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i - 1},{j + 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 2} \right)}}\end{matrix} \right.$

where r is a reconstructed residual sample, {tilde over (r)} is a sampleof the losslessly coded block of video data, M and N define a size ofthe block of video data, and i and j define a location of a samplewithin the block of video data.

Example 7

The method of example 1, wherein the intra prediction mode is a diagonalup-right intra prediction mode, and wherein reconstructing residualsamples according to the residual DPCM process comprises reconstructingresidual samples according to the equation:

$r_{i,j} = \left\{ \begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{0 \leq i \leq \left( {M - 2} \right)},{j = 0}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i + 1},{j - 1},}} & {{0 \leq i \leq \left( {M - 2} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a reconstructed residual sample, {tilde over (r)} is a sampleof the losslessly coded block of video data, M and N define a size ofthe block of video data, and i and j define a location of a samplewithin the block of video data.

Example 8

The method of any combination of examples 1 to 7.

Example 9

The method of example 1, wherein the intra-prediction mode is anearly-vertical intra prediction mode, the method further comprising:not reconstructing residual samples according to the residual DPCMprocess for a first row of the losslessly coded block of video data.

Example 10

The method of example 1, wherein the intra prediction mode is anearly-horizontal intra prediction mode, the method further comprising:not reconstructing residual samples according to the residual DPCMprocess for a first column of the losslessly coded block of video data.

Example 11

The method of example 1, wherein the intra prediction mode is one of aDC intra prediction mode and a planar intra prediction mode, and whereinreconstructing residual samples according to the residual DPCM processescomprises reconstructing residual samples according to one of a verticalresidual DPCM process and a horizontal DPCM process.

Example 12

The method of example 1, wherein the intra prediction mode is one of aDC intra prediction mode and a planar intra prediction mode, and whereinreconstructing residual samples according to the residual DPCM processescomprises reconstructing residual samples according to both a verticalresidual DPCM process and a horizontal DPCM process.

Example 13

The method of example 1, wherein the intra prediction mode is a planarintra prediction mode, and wherein reconstructing residual samplesaccording to the residual DPCM processes comprises reconstructingresidual samples according to a diagonal DPCM process, a horizontal DPCMprocess, and a vertical DPCM process.

Example 14

A method for encoding video data, the method comprising: receiving ablock of video data; performing intra prediction on the block of videodata according to an intra prediction mode to produce a predictive blockof samples and residual samples, wherein the intra prediction mode isnot one of a vertical intra prediction mode and a horizontal intraprediction mode; and generating a losslessly coded block of video datafrom the residual samples using a residual differential pulse codemodulation (DPCM) process.

Example 15

The method of example 14, wherein the intra prediction mode is one of anearly-vertical intra prediction mode and a nearly-horizontal intraprediction mode.

Example 16

The method of example 15, wherein the nearly-vertical intra predictionmode is one of intra prediction modes 22 to 30, and wherein thenearly-horizontal intra prediction mode is one of intra prediction modes6 to 14.

Example 17

The method of example 15, wherein the residual DPCM process is avertical residual DPCM process for nearly-vertical intra predictionmodes, and wherein the residual DPCM process is a horizontal residualDPCM process for nearly-horizontal intra prediction modes.

Example 18

The method of example 14, wherein the intra prediction mode is adiagonal down-right intra prediction mode, and wherein generating thelosslessly coded block of video data from the residual samples using theresidual DPCM process comprises generating the losslessly coded block ofvideo data according to the equation:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - r_{{i - 1},{j - 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a residual sample, {tilde over (r)} is a sample of thelosslessly coded block of video data, M and N define a size of the blockof video data, and i and j define a location of a sample within theblock of video data.

Example 19

The method of example 14, wherein the intra prediction mode is adiagonal down-right intra prediction mode, and wherein generating thelosslessly coded block of video data from the residual samples using theresidual DPCM process comprises generating the losslessly coded block ofvideo data according to the equation:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = \left( {N - 1} \right)}} \\{r_{i,j} - r_{{i - 1},{j + 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 2} \right)}}\end{matrix} \right.$

where r is a residual sample, {tilde over (r)} is a sample of thelosslessly coded block of video data, M and N define a size of the blockof video data, and i and j define a location of a sample within theblock of video data.

Example 20

The method of example 14, wherein the intra prediction mode is adiagonal down-right intra prediction mode, and wherein generating thelosslessly coded block of video data from the residual samples using theresidual DPCM process comprises generating the losslessly coded block ofvideo data according to the equation:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{0 \leq i \leq \left( {M - 2} \right)},{j = 0}} \\{r_{i,j} - r_{{i + 1},{j - 1},}} & {{0 \leq i \leq \left( {M - 2} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a residual sample, {tilde over (r)} is a sample of thelosslessly coded block of video data, M and N define a size of the blockof video data, and i and j define a location of a sample within theblock of video data.

Example 21

The method of any combination of examples 14 to 20.

Example 22

The method of example 14, wherein the intra-prediction mode is anearly-vertical intra prediction mode, the method further comprising:not generating the losslessly coded block of video data using theresidual DPCM process for a first row of the block of video data.

Example 23

The method of example 14, wherein the intra prediction mode is anearly-horizontal intra prediction mode, the method further comprising:not generating the losslessly coded block of video data using theresidual DPCM process for a first column of the block of video data.

Example 24

The method of example 14, wherein the intra prediction mode is one of aDC intra prediction mode and a planar intra prediction mode, and whereingenerating the losslessly coded block of video data from the residualsamples using the residual DPCM processes comprises generating thelosslessly coded block of video data from the residual samples accordingto one of a vertical residual DPCM process and a horizontal DPCMprocess.

Example 25

The method of example 14, wherein the intra prediction mode is one of aDC intra prediction mode and a planar intra prediction mode, and whereingenerating the losslessly coded block of video data from the residualsamples using the residual DPCM processes comprises generating thelosslessly coded block of video data from the residual samples accordingto both a vertical residual DPCM process and a horizontal DPCM process.

Example 26

The method of example 14, wherein the intra prediction mode is a planarintra prediction mode, and wherein generating the losslessly coded blockof video data from the residual samples using the residual DPCMprocesses comprises generating the losslessly coded block of video datafrom the residual samples according to a diagonal DPCM process, ahorizontal DPCM process, and a vertical DPCM process.

Example 27

An apparatus configured to decode video data, the apparatus comprising:means for receiving a block of video data encoded using lossless codingand intra prediction; means for reconstructing residual samples from thelosslessly coded block of video data according to a residualdifferential pulse code modulation (DPCM) process; and means forperforming intra prediction according to an intra prediction mode usingthe residual samples to produce reconstructed video samples, wherein theintra prediction mode is not one of a vertical intra prediction mode anda horizontal intra prediction mode.

Example 28

The apparatus of example 27, wherein the intra prediction mode is one ofa nearly-vertical intra prediction mode and a nearly-horizontal intraprediction mode.

Example 29

The apparatus of example 28, wherein the nearly-vertical intraprediction mode is one of intra prediction modes 22 to 30, and whereinthe nearly-horizontal intra prediction mode is one of intra predictionmodes 6 to 14.

Example 30

The apparatus of example 28, wherein the residual DPCM process is avertical residual DPCM process for nearly-vertical intra predictionmodes, and wherein the residual DPCM process is a horizontal residualDPCM process for nearly-horizontal intra prediction modes.

Example 31

The apparatus of example 27, wherein the intra prediction mode is adiagonal down-right intra prediction mode, and wherein the means forreconstructing residual samples according to the residual DPCM processcomprises means for reconstructing residual samples according to theequation:

$r_{i,j} = \left\{ \begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i - 1},{j - 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a reconstructed residual sample, {tilde over (r)} is a sampleof the losslessly coded block of video data, M and N define a size ofthe block of video data, and i and j define a location of a samplewithin the block of video data.

Example 32

The apparatus of example 27, wherein the intra prediction mode is adiagonal down-left intra prediction mode, and wherein the means forreconstructing residual samples according to the residual DPCM processcomprises means for reconstructing residual samples according to theequation:

$r_{i,j} = \left\{ \begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i - 1},{j + 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 2} \right)}}\end{matrix} \right.$

where r is a reconstructed residual sample, {tilde over (r)} is a sampleof the losslessly coded block of video data, M and N define a size ofthe block of video data, and i and j define a location of a samplewithin the block of video data.

Example 33

The apparatus of example 27, wherein the intra prediction mode is adiagonal up-right intra prediction mode, and wherein the means forreconstructing residual samples according to the residual DPCM processcomprises means for reconstructing residual samples according to theequation:

$r_{i,j} = \left\{ \begin{matrix}{{\overset{\sim}{r}}_{i,j},} & {{i = \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}} \\{{\overset{\sim}{r}}_{i,j},} & {{0 \leq i \leq \left( {M - 2} \right)},{j = 0}} \\{{\overset{\sim}{r}}_{i,j} + r_{{i + 1},{j - 1},}} & {{0 \leq i \leq \left( {M - 2} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a reconstructed residual sample, {tilde over (r)} is a sampleof the losslessly coded block of video data, M and N define a size ofthe block of video data, and i and j define a location of a samplewithin the block of video data.

Example 34

The apparatus of any combination of examples 27 to 33.

Example 35

The apparatus of example 27, wherein the intra-prediction mode is anearly-vertical intra prediction mode, the apparatus further comprising:means for not reconstructing residual samples according the residualDPCM process for a first row of the losslessly coded block of videodata.

Example 36

The apparatus of example 27, wherein the intra prediction mode is anearly-horizontal intra prediction mode, the apparatus furthercomprising: means for not reconstructing residual samples according theresidual DPCM process for a first column of the losslessly coded blockof video data.

Example 37

The apparatus of example 27, wherein the intra prediction mode is one ofa DC intra prediction mode and a planar intra prediction mode, andwherein the means for reconstructing residual samples according to theresidual DPCM processes comprises means for reconstructing residualsamples according to one of a vertical residual DPCM process and ahorizontal DPCM process.

Example 38

The apparatus of example 27, wherein the intra prediction mode is one ofa DC intra prediction mode and a planar intra prediction mode, andwherein the means for reconstructing residual samples according to theresidual DPCM processes comprises means for reconstructing residualsamples according to both a vertical residual DPCM process and ahorizontal DPCM process.

Example 39

The apparatus of example 27, wherein the intra prediction mode is aplanar intra prediction mode, and wherein the means for reconstructingresidual samples according to the residual DPCM processes comprisesmeans for reconstructing residual samples according to a diagonal DPCMprocess, a horizontal DPCM process, and a vertical DPCM process.

Example 40

An apparatus configured to encode video data, the apparatus comprising:means for receiving a block of video data; means for performing intraprediction on the block of video data according to an intra predictionmode to produce residual samples, wherein the intra prediction mode isnot one of a vertical intra prediction mode and a horizontal intraprediction mode; and means for generating a losslessly coded block ofvideo data from the residual samples using a residual differential pulsecode modulation (DPCM) process.

Example 41

The apparatus of example 40, wherein the intra prediction mode is one ofa nearly-vertical intra prediction mode and a nearly-horizontal intraprediction mode.

Example 42

The apparatus of example 41, wherein the nearly-vertical intraprediction mode is one of intra prediction modes 22 to 30, and whereinthe nearly-horizontal intra prediction mode is one of intra predictionmodes 6 to 14.

Example 43

The apparatus of example 41, wherein the residual DPCM process is avertical residual DPCM process for nearly-vertical intra predictionmodes, and wherein the residual DPCM process is a horizontal residualDPCM process for nearly-horizontal intra prediction modes.

Example 44

The apparatus of example 40, wherein the intra prediction mode is adiagonal down-right intra prediction mode, and wherein the means forgenerating the losslessly coded block of video data from the residualsamples using the residual DPCM process comprises means for generatingthe losslessly coded block of video data according to the equation:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - r_{{i - 1},{j - 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a residual sample, {tilde over (r)} is a sample of thelosslessly coded block of video data, M and N define a size of the blockof video data, and i and j define a location of a sample within theblock of video data.

Example 45

The apparatus of example 40, wherein the intra prediction mode is adiagonal down-right intra prediction mode, and wherein the means forgenerating the losslessly coded block of video data from the residualsamples using the residual DPCM process comprises means for generatingthe losslessly coded block of video data according to the equation:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{1 \leq i \leq \left( {M - 1} \right)},{j = \left( {N - 1} \right)}} \\{r_{i,j} - r_{{i - 1},{j + 1},}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 2} \right)}}\end{matrix} \right.$

where r is a residual sample, {tilde over (r)} is a sample of thelosslessly coded block of video data, M and N define a size of the blockof video data, and i and j define a location of a sample within theblock of video data.

Example 46

The apparatus of example 40, wherein the intra prediction mode is adiagonal down-right intra prediction mode, and wherein the means forgenerating the losslessly coded block of video data from the residualsamples using the residual DPCM process comprises means for generatingthe losslessly coded block of video data according to the equation:

${\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{r_{i,j},} & {{i = \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}} \\{r_{i,j},} & {{0 \leq i \leq \left( {M - 2} \right)},{j = 0}} \\{r_{i,j} - r_{{i + 1},{j - 1},}} & {{0 \leq i \leq \left( {M - 2} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.$

where r is a residual sample, {tilde over (r)} is a sample of thelosslessly coded block of video data, M and N define a size of the blockof video data, and i and j define a location of a sample within theblock of video data.

Example 47

The apparatus of any combination of examples 40 to 46.

Example 48

The apparatus of example 40, wherein the intra-prediction mode is anearly-vertical intra prediction mode, the apparatus further comprising:means for not generating the losslessly coded block of video data usingthe residual DPCM process for a first row of the block of video data.

Example 49

The apparatus of example 40, wherein the intra prediction mode is anearly-horizontal intra prediction mode, the apparatus furthercomprising: means for not generating the losslessly coded block of videodata using the residual DPCM process for a first column of the block ofvideo data.

Example 50

The apparatus of example 40, wherein the intra prediction mode is one ofa DC intra prediction mode and a planar intra prediction mode, andwherein the means for generating the losslessly coded block of videodata from the residual samples using the residual DPCM processescomprises means for generating the losslessly coded block of video datafrom the residual samples according to one of a vertical residual DPCMprocess and a horizontal DPCM process.

Example 51

The apparatus of example 40, wherein the intra prediction mode is one ofa DC intra prediction mode and a planar intra prediction mode, andwherein the means for generating the losslessly coded block of videodata from the residual samples using the residual DPCM processescomprises means for generating the losslessly coded block of video datafrom the residual samples according to both a vertical residual DPCMprocess and a horizontal DPCM process.

Example 52

The apparatus of example 40, wherein the intra prediction mode is aplanar intra prediction mode, and wherein the means for generating thelosslessly coded block of video data from the residual samples using theresidual DPCM processes comprises means for generating the losslesslycoded block of video data from the residual samples according to adiagonal DPCM process, a horizontal DPCM process, and a vertical DPCMprocess.

Example 53

A video decoder configured to perform any combination of the methods ofexamples 1 to 13.

Example 54

A video encoder configured to perform any combination of the methods ofexamples 14 to 26.

Example 55

A computer-readable storage medium storing instructions that, whenexecuted, cause one or more processors of a device configured to decodevideo data to perform any combination of the methods of examples 1 to13.

Example 56

A computer-readable storage medium storing instructions that, whenexecuted, cause one or more processors of a device configured to encodevideo data to perform any combination of the methods of examples 14 to26.

The following paragraphs provide a fifth series of examples inaccordance with one or more techniques of this disclosure.

Example 1

A method of coding video data, the method comprising: generatingprediction samples for horizontal intra coding of a block of video data,wherein for every column of the block of video data, the predictionsamples include a gradient term.

Example 2

The method of example 1, wherein the gradient term for the predictionsamples in an initial row are given by ((P_(−1,j)−P_(−1,j−1))>>1).

Example 3

The method of any of examples 1-2, wherein a prediction sample forP_(0,j), 0≦j≦N−1 is: Clip(P_(0,j−1)+((P_(−1,j)−P_(−1,j−1))>>1)).

Example 4

The method of any of examples 1-3, wherein the prediction samples forP_(i,j), 0≦i≦M−1, 0≦j≦N−1 are given byChip(P_(i,j−1)+((P_(i−1,j)−P_(i−1,j−1))>>1)).

Example 5

The method of any of examples 5-8, wherein the method is applied forlossless horizontal intra coding.

Example 6

A method of coding video data, the method comprising: generatingprediction samples for vertical intra coding of a block of video data,wherein for every row of the block of video data, the prediction samplesinclude a gradient term.

Example 7

The method of example 6, wherein the gradient term for the predictionsamples in an initial column are given as ((P_(i−1)−P_(i−1,−1)>>)1).

Example 8

The method of any of examples 6-7, wherein a prediction sample forP_(t,0), 0≦t≦M−1 is Clip(P_(t−1,0)+((P_(t−1)−P_(t−1),−1)>>1)).

Example 9

The method of any of examples 6-8, wherein the prediction samples forP_(t,j), 0≦t≦M−1, 0≦j≦N−1 are given byClip(P_(t−1,j)+((P_(t,j−1)−P_(t−1,j−1))>>1))

Example 10

The method of any of examples 6-9, wherein the method is applied forlossless vertical intra coding.

Example 11

The method any combination of examples 1-10.

Example 12

The method of any of examples 1-10 or combinations thereof, wherein themethod is performed by an encoder and wherein coding refers to encoding.

Example 13

The method of any of examples 1-10 or combinations thereof, wherein themethod is performed by a decoder and wherein coding refers to decoding.

Example 14

A system configured to perform the method of any of examples 1-10 orcombinations thereof

Example 15

A non-transitory computer readable storage medium storing instructionsthat when executed cause one or more processors to perform the method ofany of examples 1-10 or combinations thereof.

Example 16

A video encoding device configured to perform the method of any ofexamples 1-10 or combinations thereof.

Example 17

A video decoding device configured to perform the method of any ofexamples 1-10 or combinations thereof.

Example 18

A video encoding device comprising means for performing the steps of themethod of any of examples 1-10 or combinations thereof.

Example 19

A video decoding device comprising means for performing the steps of themethod of any of examples 1-10 or combinations thereof.

In one or more examples, the functions described herein may beimplemented in hardware, software, firmware, or any combination thereof.If implemented in software, the functions may be stored on ortransmitted over, as one or more instructions or code, acomputer-readable medium and executed by a hardware-based processingunit. Computer-readable media may include computer-readable storagemedia, which corresponds to a tangible medium such as data storagemedia, or communication media including any medium that facilitatestransfer of a computer program from one place to another, e.g.,according to a communication protocol. In this manner, computer-readablemedia generally may correspond to (1) tangible computer-readable storagemedia which is non-transitory or (2) a communication medium such as asignal or carrier wave. Data storage media may be any available mediathat can be accessed by one or more computers or one or more processorsto retrieve instructions, code and/or data structures for implementationof the techniques described in this disclosure. A computer programproduct may include a computer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, CD-ROM or other optical diskstorage, magnetic disk storage, or other magnetic storage devices, flashmemory, or any other medium that can be used to store desired programcode in the form of instructions or data structures and that can beaccessed by a computer. Also, any connection is properly termed acomputer-readable medium. For example, if instructions are transmittedfrom a website, server, or other remote source using a coaxial cable,fiber optic cable, twisted pair, digital subscriber line (DSL), orwireless technologies such as infrared, radio, and microwave, then thecoaxial cable, fiber optic cable, twisted pair, DSL, or wirelesstechnologies such as infrared, radio, and microwave are included in thedefinition of medium. It should be understood, however, thatcomputer-readable storage media and data storage media do not includeconnections, carrier waves, signals, or other transient media, but areinstead directed to non-transient, tangible storage media. Disk anddisc, as used herein, includes compact disc (CD), laser disc, opticaldisc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wheredisks usually reproduce data magnetically, while discs reproduce dataoptically with lasers. Combinations of the above should also be includedwithin the scope of computer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablelogic arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide varietyof devices or apparatuses, including a wireless handset, an integratedcircuit (IC) or a set of ICs (e.g., a chip set). Various components,modules, or units are described in this disclosure to emphasizefunctional aspects of devices configured to perform the disclosedtechniques, but do not necessarily require realization by differenthardware units. Rather, as described above, various units may becombined in a codec hardware unit or provided by a collection ofinteroperative hardware units, including one or more processors asdescribed above, in conjunction with suitable software and/or firmware.

Various examples have been described. These and other examples arewithin the scope of the following claims.

What is claimed is:
 1. A method of decoding video data, the methodcomprising: obtaining syntax elements from a bitstream that includes asequence of bits that form a coded representation of the video data,wherein obtaining the syntax elements from the bitstream comprisesdetermining that sign data hiding is disabled for a current block if thecurrent block is generated using lossy coding without application of atransform to residual data and the current block is intra predictedusing an intra prediction mode in which a residual differential pulsecode modulation (DPCM) technique is used; and reconstructing a pictureof the video data based at least in part on the syntax elements obtainedfrom the bitstream.
 2. The method of claim 1, wherein obtaining thesyntax elements from the bitstream further comprises: when sign datahiding is disabled for the current block, obtaining, from the bitstream,for each respective significant residual value in the current block, asyntax element indicating whether the respective significant residualvalue is positive or negative, and when sign data hiding is not disabledfor the current block, not obtaining from the bitstream a syntax elementindicating whether a value of a significant residual value in thecurrent block is positive or negative.
 3. The method of claim 1, whereinobtaining the syntax elements from the bitstream comprises obtaining,from the bitstream, an explicit indication that sign data hiding isenabled for the current block.
 4. The method of claim 1, whereindetermining that sign data hiding is disabled for the current blockcomprises determining that sign data hiding is disabled for the currentblock if: the current block is coded without application of thetransform to the residual data of the current block, and the currentblock is intra coded using a DC intra prediction mode or a planar intraprediction mode.
 5. The method of claim 1, wherein the intra predictionmode in which residual DPCM is applied is a horizontal or vertical intraprediction mode.
 6. The method of claim 1, wherein reconstructing thepicture comprises: generating a block of residual values that includesthe current block, wherein the block is a transform skip block; and for0≦i≦(M−1) and 0≦j≦(N−1), where M is a height of the block and N is thewidth of the block, the method comprises: calculating a reconstructedresidual value Q(r_(i,j)) corresponding to a residual value r_(i,j) inthe block, wherein if the block is coded using a vertical intraprediction mode, Q(r_(i,j)) is defined as:${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{{i - 1},j} \right)}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q({tilde over (r)}_(i,j)) denotes aquantized version of a modified residual value {tilde over (r)}_(i,j),the modified residual value {tilde over (r)}_(i,j) is a modified versionof the residual value r_(r,j), and Q(r_(i−1,j)) is a reconstructedresidual value corresponding to a residual value one column left of theresidual value r_(i,j), and wherein if the block is coded using ahorizontal intra prediction mode, Q(r_(i,j)) is defined as:${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{i,{j - 1}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q(r_(i,j−1)) is a reconstructed residualvalue corresponding to a residual value one row above the residual valuer_(i,j); and adding the reconstructed residual value Q(r_(i,j)) to aprediction value to reconstruct a sample value.
 7. A method of encodingvideo data, the method comprising: generating a bitstream that includesa sequence of bits that forms a coded representation of the video data,wherein generating the bitstream comprises determining that sign datahiding is disabled for a current block if the current block is generatedwithout application of a transform to residual data and the currentblock is intra predicted using an intra prediction mode in which aresidual differential pulse code modulation (DPCM) technique is used;and outputting the bitstream.
 8. The method of claim 7, whereingenerating the bitstream comprises: when sign data hiding is disabledfor the current block, signaling, in the bitstream, for each respectivesignificant residual value in the current block, a syntax elementindicating whether the respective significant residual value is positiveor negative, and when sign data hiding is not disabled for the currentblock, not signaling, in the bitstream, a syntax element indicatingwhether a value of a significant residual value in the current block ispositive or negative.
 9. The method of claim 7, wherein generating thebitstream comprises signaling, in the bitstream, an explicit indicationthat sign data hiding is enabled for the current block.
 10. The methodof claim 7, wherein determining that sign data hiding is disabled forthe current block comprises determining that sign data hiding isdisabled for the current block if: the current block is coded withoutapplication of the transform to the residual data of the current block,and the current block is intra coded using a DC intra prediction mode ora planar intra prediction mode.
 11. The method of claim 7, wherein theintra prediction mode in which residual DPCM is applied is a horizontalor vertical intra prediction mode.
 12. The method of claim 7, furthercomprising: for 0≦i≦(M−1) and 0≦j≦(N−1), where M is a height of a blockthat includes the current block and N is the width of the block, whereinthe block is a transform skip block; determining a modified residualvalue {tilde over (r)}_(i,j) for a residual value r_(i,j), wherein ifthe block is coded using a vertical intra prediction mode, {tilde over(r)}_(i,j) is defined as:${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{r_{i,j} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q(r_((i−1),j)) denotes a reconstructedresidual value corresponding to a residual value r_(i−1,j) one columnleft of the residual value r_(i,j), and if the block is coded using ahorizontal intra prediction mode, is defined as:${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - {Q\left( r_{i,{({j - 1})}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q(r_((i−1),j)) denotes a reconstructedresidual value corresponding to a residual value r_(i−1,j) one row abovethe residual value r_(i,j), and quantizing the modified residual value{tilde over (r)}_(i,j) to produce a quantized modified residual valueQ({tilde over (r)}_(i,j)).
 13. A video coding apparatus comprising: amemory that stores data; and one or more processors configured todetermine that sign data hiding is disabled for a current block if thecurrent block is generated using lossy coding without application of atransform to residual data and the current block is intra predictedusing an intra prediction mode in which a residual differential pulsecode modulation (DPCM) technique is used.
 14. The video coding apparatusof claim 13, wherein the one or more processors are configured to:obtain, when sign data hiding is disabled for the current block, from abitstream, for each respective significant residual value in the currentblock, a syntax element indicating whether the respective significantresidual value is positive or negative, and not obtain, when sign datahiding is not disabled for the current block, from the bitstream asyntax element indicating whether a value of a significant residualvalue in the current block is positive or negative.
 15. The video codingapparatus of claim 13, wherein the one or more processors are configuredto obtain, from a bitstream, an explicit indication that sign datahiding is enabled for the current block.
 16. The video coding apparatusof claim 13, wherein the one or more processors are configured to:signal, when sign data hiding is disabled for the current block, in abitstream, for each respective significant residual value in the currentblock, a syntax element indicating whether the respective significantresidual value is positive or negative, and not signal, when sign datahiding is not disabled for the current block, in the bitstream, a syntaxelement indicating whether a value of a significant residual value inthe current block is positive or negative.
 17. The video codingapparatus of claim 13, wherein the one or more processors are configuredto signal, in a bitstream, an explicit indication that sign data hidingis enabled for the current block.
 18. The video coding apparatus ofclaim 13, wherein determining that sign data hiding is disabled for thecurrent block comprises determining that sign data hiding is disabledfor the current block when: the current block is coded withoutapplication of the transform to the residual data of the current block,and the current block is intra coded using a DC intra prediction mode ora planar intra prediction mode.
 19. The video coding apparatus of claim13, wherein the intra prediction mode in which residual DPCM is appliedis a horizontal or vertical intra prediction mode.
 20. The video codingapparatus of claim 13, wherein the one or more processors are configuredto: generate a block of residual values that includes the current block,wherein the block is a transform skip block; and for 0≦i≦(M−1) and0≦j≦(N−1), where M is a height of the block and N is the width of theblock, the one or more processors are configured to: calculate areconstructed residual value Q(r_(i,j)) corresponding to a residualvalue r_(i,j) in the block, wherein if the block is coded using avertical intra prediction mode, Q(r_(i,j)) is defined as:${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{{i - 1},j} \right)}} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q({tilde over (r)}_(i,j)) denotes aquantized version of a modified residual value {tilde over (r)}_(i,j),the modified residual value {tilde over (r)}_(i,j) is a modified versionof the residual value r_(i,j), and Q(r_(i,j)) is a reconstructedresidual value corresponding to a residual value one column left of theresidual value r_(i,j), and wherein if the block is coded using ahorizontal intra prediction mode, Q(r_(i,j)) is defined as:${Q\left( r_{i,j} \right)} = \left\{ {\begin{matrix}{{Q\left( {\overset{\sim}{r}}_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0},} \\{{Q\left( {\overset{\sim}{r}}_{i,j} \right)} + {Q\left( r_{i,{j - 1}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q(r_(i,j−1)) is a reconstructed residualvalue corresponding to a residual value one row above the residual valuer_(i,j); and add the reconstructed residual value Q(r_(i,j)) to aprediction value to reconstruct a sample value.
 21. The video codingapparatus of claim 13, wherein the one or more processors are configuredto: for 0≦i≦(M−1) and 0≦j≦(N−1), where M is a height of a block thatincludes the current block and N is the width of the block, wherein theblock is a transform skip block; determine a modified residual {tildeover (r)}_(i,j) value for a residual value r_(i,j), wherein if the blockis coded using a vertical intra prediction mode, {tilde over (r)}_(i,j)is defined as: ${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{r_{i,j} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q(r_((i−1),j)) denotes a reconstructedresidual value corresponding to a residual value r_(i−1,j) one columnleft of the residual value r_(i,j), and if the block is coded using ahorizontal intra prediction mode, {tilde over (r)}_(i,j) is defined as:${\overset{\sim}{r}}_{i,j} = \left\{ {\begin{matrix}{r_{i,j},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{r_{i,j} - {Q\left( r_{i,{({j - 1})}} \right)}} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix},} \right.$ wherein Q(r_(i,(j−1))) denotes a reconstructedresidual value corresponding to a residual value r_(i,j−1) one row abovethe residual value r_(i,j); and quantize the modified residual value{tilde over (r)}_(i,j) to produce a quantized modified residual valueQ({tilde over (r)}_(i,j)).
 22. The video coding apparatus of claim 13,wherein the video encoding apparatus comprises at least one of: anintegrated circuit; a microprocessor; and a wireless communicationdevice that includes the coder.
 23. A video decoding apparatuscomprising: means for obtaining syntax elements from a bitstream thatincludes a sequence of bits that form a coded representation of thevideo data, wherein obtaining the syntax elements from the bitstreamcomprises determining that sign data hiding is disabled for a currentblock if the current block is generated using lossy coding withoutapplication of a transform to residual data and the current block isintra predicted using an intra prediction mode in which a residualdifferential pulse code modulation (DPCM) technique is used; and meansfor reconstructing a picture of the video data based at least in part onthe syntax elements obtained from the bitstream.
 24. A video encodingapparatus comprising: means for generating a bitstream that includes asequence of bits that forms a coded representation of the video data,wherein generating the bitstream comprises determining that sign datahiding is disabled for a current block if the current block is generatedusing lossy coding without application of a transform to residual dataand the current block is intra predicted using an intra prediction modein which a residual differential pulse code modulation (DPCM) techniqueis used; and means for outputting the bitstream.
 25. A non-transitorycomputer-readable data storage medium having instructions stored thereonthat, when executed, cause one or more processors to: determine thatsign data hiding is disabled for a current block if the current block isgenerated using lossy coding without application of a transform toresidual data and the current block is intra predicted using an intraprediction mode in which a residual differential pulse code modulation(DPCM) technique is used.